Digital Electronics

not familar with uart or ?

Got a an electronics question of digital nature? Ask away here

not familar with uart or ?

Postby MrDEB » Thu Feb 04, 2010 12:44 am

wanting to connect a pic circuit (keep track of 4 inputs , time the inputs and set into priority of 1, 2, 3, 4)
then input this data into a PC (assuming uart is a usb cable?) or as serial data as most computers do not have parallel ports anymore.
am I right is thinking that a uart is the method to use? not even sure a uart is a two way communication?
looked at the Swordfish module about multi tasking, this is a start I think?
NOTE the only thing I have done using usart is the hello world program on a Junebug.
User avatar
MrDEB
Loyal Member
Loyal Member
 
Posts: 329
Joined: Tue Apr 07, 2009 10:10 pm

Re: not familar with uart or ?

Postby Roshan » Thu Feb 04, 2010 3:31 am

usart is bi-directional communication. You can send data to pc & can receive data from pc.
To know that we know what we know, and to know that we do not know what we do not know, that is true knowledge
User avatar
Roshan
Resident Guru
Resident Guru
 
Posts: 132
Joined: Tue Jun 30, 2009 7:29 pm

Re: not familar with uart or ?

Postby Jon Chandler » Thu Feb 04, 2010 4:16 pm

Searching on UART turns up 100 listings here, including at least 2 tutorials. That might be a good first step if you don't understand something.

The data sheet for PIC micro-controllers is big and scary but you don't have to read the entire thing. UART is explained there in a paragraph.

The Swordfish help file is a great reference too.

People will be happy to help here, but the basic concepts are well documented. People would rather help with real problems than answering questions about the basics.

All that being said, there are a couple important details. Swordfish supports the hardware UART (or even 2 on some chips) and software UARTs too. Using the hardware UART is the best bet - software UARTs have some gotchas, particularly when receiving data.

UARTs are typically used for RS-232 connections. RS-232 uses levels of +/- 9-12 volts for signaling. The PIC puts out 0 / 5 volt signals. A MAX232 chip is used to convert levels. If your PIC board has an RS-232 chip, you can (make that MUST) use an RS-232 - USB converter to connect to a PC without a serial port.

If your PIC board does not have a MAX232 chip, you need a "UART" to USB converter. It will handle the 0 / 5 volt levels from the PIC. These can be found on eBay and are often used with cell phones.

Alternatively, a PICkit 2 contains a UART tool that will connect to the 0 / 5 volt levels of a PIC to display the serial data on a PC.

Jon
User avatar
Jon Chandler
Moderator
Moderator
 
Posts: 350
Joined: Thu Oct 22, 2009 6:16 am
Location: Seattle WA, USA

Re: not familar with uart or ?

Postby Jon Chandler » Thu Feb 04, 2010 4:19 pm

This link will explain a lot too:

http://www.lmgtfy.com/?q=UART+PIC
User avatar
Jon Chandler
Moderator
Moderator
 
Posts: 350
Joined: Thu Oct 22, 2009 6:16 am
Location: Seattle WA, USA

Re: not familar with uart or ?

Postby Graham » Thu Feb 04, 2010 8:12 pm

Jon Chandler wrote:This link will explain a lot too:

http://www.lmgtfy.com/?q=UART+PIC


Heh, now that's the first time I've ever seen that site!
User avatar
Graham
Moderator
Moderator
 
Posts: 618
Joined: Wed Apr 01, 2009 10:34 pm

Re: not familar with uart or ?

Postby Jon Chandler » Thu Feb 04, 2010 9:25 pm

My partner pointed it out to me. I love it.
User avatar
Jon Chandler
Moderator
Moderator
 
Posts: 350
Joined: Thu Oct 22, 2009 6:16 am
Location: Seattle WA, USA


Return to Digital Electronics

Site Login