10-04-2010 04:31 PM
Hi,
I need do the SPI Communication with PIC24HJ256GP210 hardware in LabVIEW 2010 with NI USB 8451.I would like to send 8 byte data and receive 8 byte data from PIC.I will be sending data byte by byte by changing the Chip Select(CS) signal.Before sending data I will be sending ENQ(Enquire as 3A) for checking PIC status then after receiving ACK(Acknowledge as A1),I will send the data packet.
My testing Procedure given below,
Please review my testing procedure and give your input if you have worked with SPI or if you have any input for my query.
Thanks in Advance.
Note: Attached my code with this mail for your reference.
Regards,
Natarajan.
Solved! Go to Solution.
11-16-2010 09:38 AM
Hello Natarajan,
Are you writing the code in the PIC24HJ256GP210?
In any case, it is possible the PIC24HJ256GP210 is returning your valid data during "Send DataPacket". You could always try looking at that data in LabVIEW:
(I've modified the code to send all the 8 bytes of the data packet. This is more efficient. Why are you doing it "byte by byte". Is it to toggle chip select after every byte? Is that necessary?)
If that doesn't work, then we may need to look at what the PIC24HJ256GP210 is doing...
11-16-2010 01:16 PM
Hello O_Proulx,
Thanks for your Reply.
In SPI communication after sending the data we need to send again meaningless bytes that is equivalent to how many bytes we would like to receive from the Response System.So we can't read the data in the same VI as you mentioned in the code.
My problem has been solved.Meaningless byte i need to send as "AB".beacuse the HEX file has been developed in that way.
Regards,
Natarajan.