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.

does UART have a shift register in it?

Status
Not open for further replies.

Dr_Doggy

Well-Known Member
I understand it implies serial communication, but do I need to align the code, IE; if I ping a device do i need to wait for the response, or can I come back to it later(after the response data has been shifted in)?

What about the SPI, the device won't respond until the clock on the master is running right?
 
what if i dont want to interrupt, spi is the way to go>?

can I time the spi response to wait for the clock ?

also I can use spi for a standard serial port input right?
 
If you don't want an interrupt then don't enable it.

Don't understand question 2.

You can use SPI as a clocked serial input.

Mike.
 
OK i think i got it, so if i want to link 2 pics, uart is the way to go? I just worry since my 2nd device is time sensitive, and needs to hit a routine every 10ms.

2) IE..SPI... If i stop the clock will the code wait to "finish the data" or IF i ping a device, do i need to wait and listen for its response, or can I ping, do other code, then go back to pickup the ping response?
 
If you use UART at 9600 baud then a byte may be received every mS but it can be easily handled with an interrupt. You could even implement a fifo so the send/receive is transparent. Hitting a routine 100 times per second should be very easy to achieve. Edit, you can easily run at a much higher baud rate.

With SPI, when you place a byte in the buffer the two pics swap there respective buffers so you have to preload the slave buffer. Once the master buffer is loaded, you can do whatever you like because the swapped byte will just remain in the buffer until you read it.

Mike.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top