MOD 5213 SPI questions?

Discussion to talk about software related topics only.
Post Reply
Haiyang
Posts: 11
Joined: Wed Mar 09, 2011 8:45 am

MOD 5213 SPI questions?

Post by Haiyang »

I am trying to set up the SPI communication between NB Mod 5213 and AD-5932 chip. However, there is something wrong that I couldn't figure it out. Basically I tried to send 6 word (each word is 16 bit) from Mod 5213 to the Ad-5932. CS pin idles high and drops to low when the data is being transmitted. However, I am reading 7 intervals of low instead of 6 intervals. I doubted that this may cause the failure of the communication with AD-5932. The figure attached shows the chip select pin during the writing.

My basic SPI settings are listed in the following:
(1) baud rate about 0.258MHz
(2) CPOL = 0, CPHA = 1;
(3) transfer size: 16 bit
(4) Master mode
(5) SPI clock delay: about 45 ns
(6) SPI delay after transfer: about 4 ms
(7) Chip selects return to inactive level (1 high) when a single word transfer is over.

void Write2SPI()
{
sim.spi.qmr=0xC180;//0.258MHz Baud Rate IMU Data
sim.spi.qdlyr=0x0380;
sim.spi.qar=0x0020;// select the first command RAM entry

sim.spi.qdr=0x7B00;
sim.spi.qdr=0x7B00;
sim.spi.qdr=0x7B00;
sim.spi.qdr=0x7B00;
sim.spi.qdr=0x7B00;
sim.spi.qdr=0x7B00;

sim.spi.qar=0x0000; //select the first transmit ram entry IMU Data
sim.spi.qdr=Control_Bits;
sim.spi.qdr=N_INCR;
sim.spi.qdr=Delta_F_LSB;
sim.spi.qdr=Delta_F_MSB;
sim.spi.qdr=F_Start_LSB;
sim.spi.qdr=F_Start_MSB;
sim.spi.qwr=0x1900; //not cont
sim.spi.qdlyr=0x8000);
}

Can somebody shed some lights to my problem? Thanks in advance
Attachments
scope.jpg
scope.jpg (1.18 MiB) Viewed 2841 times
Post Reply