PDA

View Full Version : 16f628a usart



c_moore
- 26th August 2012, 18:33
Hello everyone,

does anyone have a working example using a 16f628a USART? I am trying to just send a byte and echo it back to the serial terminal. I am using a Easypic7. Thanks for any help.

mackrackit
- 27th August 2012, 13:20
http://melabs.com/samples/PBP-mixed/usart.htm

c_moore
- 27th August 2012, 22:27
Thanks for the reply Mackrat. I will try it,but I don't see how that will work for a 16F628a.

mackrackit
- 28th August 2012, 09:50
Thanks for the reply Mackrat. I will try it,but I don't see how that will work for a 16F628a.
Why would it not work? It is a demo on how to use the hardware serial port.

c_moore
- 29th August 2012, 09:59
Hi Mackrackit,

Im using a 16f628a and it looks like the code is for a 16F877a or something because it uses port C 6 and 7 for rx and tx. anyway I got something working. it turns out that on a easypic7 when using a 16f pic I needed to use the 18B socket. so once I got the right socket everything started working. thanks.

keithdoxey
- 29th August 2012, 12:57
Look at the Datasheets. 16F877 uses C6 and C7 as you say, but the 16F628 used B1 RX and B2 TX

the only thing that I can see needs changing from a quick glance is the line....

TRISC = %10111111
to
TRISB = %11111011

aliciaDJones
- 5th September 2012, 06:04
What is 16f628a usart ???:confused:

Demon
- 7th September 2012, 06:17
What is 16f628a usart ???:confused:


UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (USART)

RX=receive
TX=transmit


Look at Hserin/Hserout commands in PBP manual.


Info on 16F628A can be found here:
http://ww1.microchip.com/downloads/en/devicedoc/40044f.pdf

Robert