Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADuC7024 to ADIS16100 SPI communication problem

Status
Not open for further replies.

Puffafish

New Member
Hi,


I’m trying to connect an ADuC7024 microcontroller (evaluation board) with an ADIS16100/PCB gyroscope via the hardware SPI. I want to be able to receive the gyroscope data and the ADC conversion results from the two AIN pins on the gyroscope.


I have all the SPI lines connected to an oscilloscope but the replies from the gyroscope do not correspond to what I’d expect, given the information on the datasheet– most importantly, the first four bits do not match to the data I am requesting (p.13 of the datasheet).


To get around the 8-bit microcontroller buffer/16-bit gyroscope output problem, my C code (compiled using IAR) reads:

//******************

SPITX = data_address_2;

SPITX = 0x00;

rxWait();

msb_data = SPIRX;

rxWait();

lsb_data = SPIRX;

//******************

Where data_address_2 is the first byte of the MOSI command sent to the gyroscope (0xB3 to request the gyro data, 0xBB for AIN1 or 0xBF for AIN2).


SCLK runs at approximately 100kHz, the core CLK of the ADuC runs at just under 42MHz and the CS line is taken low for the duration of the 16 SCLKs (otherwise high), and the shortest delay between transmissions is 20 microseconds. The SPICON register is set to 0x104B at initialisation (continuous transfer, SCLK idles high and pulses at end of each serial bit transfer, master mode enabled, SPI enabled).


The gyroscope pins ST2, ST1 and the unused AIN(s) are pulled low with 10K resistors, Vdrive is connected to a 3.3V supply and Vcc is 5V.


Having spent the last few weeks trying to get this working, I’ve tried everything I can think of – it’s now urgent that I get this problem sorted!


Please help! :(
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top