| Author |
Message |
|
|
Posted: Sep 30, 2007 - 08:30 PM |
|

Joined: Sep 23, 2006
Posts: 22
Location: netherlands
|
|
hi,
i have a microcontroller with a ADC connected to its SPI bus. i know how i can start transmitting data over an SPI bus to an slave, thats just filling the TDR register. but i have to read from the adc.
the adc sends a 24 bit value in 3 stages of 8 bits. how do i start a read from the adc? (the uC is the AT91SAM7S256 from atmel) and the adc is an MCP3551.
what do i have to do so the adc starts sending a byte? |
|
|
| |
|
|
|
|
|
Posted: Sep 30, 2007 - 10:14 PM |
|

Joined: Sep 30, 2007
Posts: 228
Location: Germany
|
|
Normally you just have to give the SPI-slave a clock signal to make it send..
If you have to configure the ADC before receiving data depends on its protocol that you may find in the datasheet.
greets |
|
|
| |
|
|
|
|
|
Posted: Sep 30, 2007 - 10:19 PM |
|

Joined: Sep 23, 2006
Posts: 22
Location: netherlands
|
|
| well the problem is (and i read the datasheet of both) i dont know how to start te clock. if i want to send ill have to place somthing in the tx register and the uC will do everything for the SPI part like emmiting a clock. but i cant find anything in the datasheet about starting a read. |
|
|
| |
|
|
|
|
|
Posted: Oct 01, 2007 - 12:50 AM |
|

Joined: Aug 12, 2007
Posts: 48
Location: Greece, Thessaloniki
|
|
|
Erikk wrote:
well the problem is (and i read the datasheet of both) i dont know how to start te clock. if i want to send ill have to place somthing in the tx register and the uC will do everything for the SPI part like emmiting a clock. but i cant find anything in the datasheet about starting a read.
So let the uC to do the work for you.
Write dummy character to output and the uC will produce the clock that will drive the slave SPI .
After each dummy character send, read the Master SPI receive register. (You will be surprised to find the reply information there!)
SPI is a very simple protocol.
Regards,
Viron. |
|
|
| |
|
|
|
|
|
Posted: Oct 01, 2007 - 09:23 AM |
|

Joined: Sep 23, 2006
Posts: 22
Location: netherlands
|
|
yes i come up with that after i posted.
thanx! |
|
|
| |
|
|
|
|
|
Posted: Oct 01, 2007 - 09:25 AM |
|


Joined: Sep 14, 2003
Posts: 4228
Location: Queanbeyan, Australia
|
|
|
Erikk wrote:
...AT91SAM7S256 from atmel...
The forum for that part is over at http://www.at91.com/
-S. |
|
|
| |
|
|
|
|
|