Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/02/08 22:36
Read: times


 
#152902 - It's two channels of communication
Responding to: ???'s previous message
Kapil Chandrakant Kinikar said:


hi,

i am kapil.

i want to interface adc MCP 3201 with 89c52 but i have some queries about software and hardware.

queries: (ans the queries by taking soft. & hard. part into consideration)

1> how controller saves D out pin, as controller is 8-bit, but adc is 12-bit, and adc communicates through serial protocol?

2> if controller wants to send the data to the RS 232 port, then how the communication will take place?




It's true that your ADC is a serial one, but it has a specific serial protocol called SPI. You have to communicate with the ADC in "bit-banged" serial format, unless your MCU has compatible SPI-dedicated hardware. That means you have to send each bit and then send a clock, before sending the next bit ... etc. Receiving, which is what you'll do in this case, is the reverse of that. In this particular case, the serial channel has a signaling protocol called SPI, for which you can search on this site and obtain considerable information. I'd suggest you do that.

If you treat the process as communication between two channels, architected in any way you like, you will receive a byte (this is an 8-bit processor, after all) and then transmit it via the serial I/O channel (UART).

You might benefit from a visit to

http://www.atmel.com/dyn/resou...oc4348.pdf

which discusses SPI.

You can decide for yourself how you'll send the data (12 bits) to the serial channel which operates on 8 bit quantities. However, it's entirely up to you, since you'll receive a 12-bit value, and process it however you like, into the format that you'll send on the UART.

You may, for example, find it convenient to send the data as nybbles (4-bit pieces) which are easily converted from binary to ASCII hexadecimal, or, you may find it just as convenient to convert the values to decimal locally before sending the data to its destination. Other options are, of course, also available.

Not knowing what your needs are, I can't recommend anything. Whatever format is appropriate for you, it can be sent over the UART to wherever it has to go.

The rate at which you intend to sample your analog data will affect how much processing you can do before the next converted value becomes available. The data rate at which you commuicate on the UART will also be a limiting factor.

RE




List of 4 messages in thread
TopicAuthorDate
Serial data            01/01/70 00:00      
It's two channels of communication            01/01/70 00:00      
about i2c bus            01/01/70 00:00      
adc 3201 interface with 89c52            01/01/70 00:00      

Back to Subject List