Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Use myRIO SPI to write and read register

Hi,

 

I am working on a 802.15.4 chip "MRF24J40", this is the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/39776C.pdf

I am trying to use SPI to write a "1" to the register "0x2E", and then read this "1" out. The read and write timing is on page 12 in this datasheet. In my LabVIEW program, when the CS(Chip Select) is low, I send the short address "0x2E" through MOSI to the chip, following the data "1". Then I try to read this register in the while loop press "Read Register" to make it true. But I only got some abnormal value rather than "1". Attached is my vi.

 

This is the first time I use LabVIEW to visit a register, there may be some very obvious mistake in my program. can anybody help me with this? Thank you so much!

 

Aoyu

Download All
0 Kudos
Message 1 of 2
(6,606 Views)

Greetings Aoyu               

 

Have you check this SPI tutorial for myRIO? You could use the Read Write Function for both the address and data messages.

 

I see that the Digital lines that you connect to the CS lines are only acted upon once (their code executes only once) So I think the reads and writes may not be complete because the CS line never goes back to the original state, as shown in Figures 2-4 and 2-5 of the data sheet of your device.

 

Let us know if you have further questions.

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(6,588 Views)