View previous topic :: View next topic |
Author |
Message |
bsodmike
Joined: 05 Aug 2006 Posts: 52
|
16F648A and 'CCS' UART on PORT RA1 |
Posted: Sat Aug 05, 2006 5:48 am |
|
|
Hi all,
I've so far only been able to get UART to work as hardware on RB1/RB2 @ 19200baud. If I try to use anything higher, hypertrm just doesn't show a thing.
So right now, I want to use RA1 as a the Tx pin, so I have this in my code:
Code: | #use rs232(baud=19200, parity=N, bits=8, xmit=PIN_A1) |
This worked for like 2 seconds and then nothing, so I'm back to using:
Code: | #use rs232(baud=19200, parity=N, bits=8, xmit=PIN_B2) |
...which should automatically implement hardware UART, and works fine, but I would like to put these ports to use. Any ideas?
Cheers,
Mike |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Sat Aug 05, 2006 7:32 am |
|
|
What speed are you running the processor at? That could provide a large clue. Also, does it work at slower speeds?
John |
|
|
bsodmike
Joined: 05 Aug 2006 Posts: 52
|
|
Posted: Sat Aug 05, 2006 11:39 am |
|
|
Hiya,
I gave up on hypertrm and installed SecureCRT. This is so much better and have got it running @ 19200 nicely. 16f648A @ 20Mhz btw.
Cheers, Mike |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 05, 2006 12:02 pm |
|
|
Quote: | #use rs232(baud=19200, parity=N, bits=8, xmit=PIN_B2)
...which should automatically implement hardware UART |
It doesn't. It's creating a software UART. You must specify both
hardware pins (rcv and xmit) in the #use rs232() statement to
generate code for a hardware UART.
Example: This will create a hardware UART.
Code: | #use rs232(baud=19200, xmit=PIN_B2, rcv=PIN_B1, ERRORS) |
|
|
|
bsodmike
Joined: 05 Aug 2006 Posts: 52
|
|
Posted: Sat Aug 05, 2006 12:49 pm |
|
|
aha!, thanks for that info. [st]What's ERRORS about? (I thought I read something on this somewhere hrm)[/st], cheers, just looked it up |
|
|
|