07-31-2008 03:13 PM
07-31-2008 04:52 PM
07-31-2008 06:28 PM
08-03-2008 05:20 PM
I figure out part of my problem, because the chip select logic level is active high all the time without any reason, if I set this pin as a triger signal in logic analyzer, there is no correct waveform.
But how to rewrite spi initialize function in labview as a simple one below:
DWORD SPIInit( void ){
S0SPCR = 0x00;
/* Configure Pin Connect Block */
PINSEL0 &= ~0xC0000000; // clear pin settings
PINSEL1 &= ~0x0000003C; // clear pin settings
PINSEL0 |= 0xC0000000; // P0.15 (SCK) enable
PINSEL1 |= 0x0000003C; // P0.17,18 (MISO, MOSI, ) enable;
IODIR0 |= SPI0_SEL;
IOSET0 |= SPI0_SEL; //port0.16 uses GPIO SPI_SEL,
/* Enable SPI power */
PCONP |= (1 << 8);
/* Set SPI clock*/
//PCLKSEL0 |= 0x00030000
/* Set SPI clock for 17~16 bit: 00------------- SPI_CLK=CCLK/4=12000000UL
11------------- SPI_CLK=CCLK/8=6000000UL */
S0SPCCR = 16; //8 set clock rate S0SPCCR = SPI_CLK / (data_transfer_clockRate)
//750 000UL
S0SPCR = (( clockPhase & 1) << 3) // set clock phase
| ((~_clockPolarity & 1) << 4) // set clock polarity
//| (1 << 4)
| (1 << 5) // set master mode
| (0 << 6) // MSB trans. first
| (4 | (8 << 8)); // set 8 bit data SPCR=0x0834
// |4;
return( TRUE );
}
03-02-2009 09:26 AM
Hello,
Does anyone still have either the SPI example vi that Kevin_S posted, or even the .jpg's? The content is no longer available through the post.
I am trying to get SPI communications up and running on the Luminary Micros ARM eval. kit. Any help would be greatly appreciated!
Regards,
Adam
03-03-2009 10:58 AM - edited 03-03-2009 10:59 AM
Hi Adam,
Here are the images that were posted previously.
Kevn S.
Applications Engineer
National Instruments
03-04-2009 02:40 AM
Hi Kevin S,
I'm new on Labview Embedded. I saw your message for example now. I couldn't take it.
if it's possible, can you share it again with us?
Thank you
03-04-2009 02:55 PM
Hi mguven,
Are you able to vew the JPEG images? I would recommend using them as a guide as to what you can do. The example is very simple.
Kevin S.
Applications Engineer
National Instruments
03-17-2009 02:22 PM
Kevin,
How about an example using the ARM as a slave? I know you can't do it directly with the supplied LV vis (why?). I tried to use MEM Peek/Poke to set it up myself, and those functions don't appear to work (why?).
NI support has been less than stellar on this. Their answer seems to be "We don't use SPI much, so we can't help you"
Thanks,
Bill F
03-20-2009 12:55 PM - edited 03-20-2009 12:58 PM
Hi Bill,
I'm talked with R&D about the use of an ARM as an SPI slave device. Currently, it doesn't look like the ability to put the ARM device in slave mode has been integrated into a VI. This option may be altered in C code (after the VI has been compiled down to C of course). I've recommended directly to the developer about the desire for this feature. For now, LabVIEW simply doesn't have a VI that can toggle that functionality though.
R&D is currently investigating the MEM Peek/Poke VIs. I know that you've been in communication with one of my colleagues regarding this issue. I encourage you to maintain your contact with her through your service request.
I apologize if NI's support hasn't been up to par with your questions. I believe the biggest hurdle with the SPI VIs is custom example creation. There's just too many SPI devices out there to create a good, generic example. Don't worry though. I've requested at this point any example of SPI bus usage as an example.
Regards,
Kevin S.
Applications Engineer
National Instruments