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.

Software UART in C

Status
Not open for further replies.

wuchy143

Member
Hi All,

I"m making a simple clock using the PIC12F675. I have the clock working but I'd like to take my 8 bit hour variable and send it out serially to a port pin which is connected up serially to hyper terminal(to see the data).

Could someone help me get a grasp as to how a serial transmitter would work? In this case it will never receive so I guess it's really a UAT. I'm not looking for code. Just a seat of the pants feel as to what I need to do. Leave the code up to me :)

Thanks

-mike
 
**broken link removed**This code has been written many times and you should find many examples if you google for "software uart" or even "bit bang".

If you look at the signal levels generated by a UART it should be easy to implement in software.

**broken link removed**
 
Last edited:
The 12F675 doesn't have built-in UART capability, but there are tons of PICs that do. For example, the 12F1822 looks like it meets or exceeds all the features of the 12F675, has built-in USART, and it's cheaper. Unless you really feel like making your own software-driven UART (an effort I would certainly applaud), then I highly recommend purchasing a UART-enabled PIC.

Either way, don't forget the MAX232 (or similar) chip. The voltage levels on your serial port are very different from the logic levels of your PIC.

-Dan
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top