views:

33

answers:

1

Hello, I want to connect ATMEGA32 microcontroller to a shift register using USART via TXD pin, the shift register then performs serial to parallel conversion on the received data. but as you know, the shift register needs clocking , this clocking is fed via the microcontroller at baud rate frequency via XCK pin (here the USART acts as master synchronous clock generator). My problem is that i don't know how to get these clock signal out of XCK, so how to do that???

thanks

+3  A: 

RS-232 is self-clocking (fix baud rate) - it typically uses x16 clock supplied to a UART which syncs to the incoming data start bit edge. Rather than use a bare shift register you would probably be better off just using a simple UART chip as your serial to parallel converter - it would save a lot of effort.

Paul R
i'm not talking about asynchronous connection of MCU to PC via RS-232 port, i just want to connect the MCU to a shift register IC directly so the MCU acts like a master synchronous to that IC
Ala ABUDEEB
@Ala: let em clarify - you said you wanted to use the USART - why not just set up the USART for RS-232, then use a simple UART chip rather than a shift register - then you get serial to parallel without any extra clock signals. Or did I misunderstand your requirements ?
Paul R
I'm just doing this for testing USART functionality.
Ala ABUDEEB
OK - I don't really see the point though - why not just hook the output up to a 'scope or something ?
Paul R
ok to be clearer, i want the USART to work in SPI mode.how?
Ala ABUDEEB
Here is a useful Atmel application note which may help on the programming and interfacing for SPI: http://www.atmel.com/dyn/resources/prod_documents/doc2577.pdf
Paul R
thanks, this is useful
Ala ABUDEEB