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.

PIC18F452 USART

Status
Not open for further replies.

jfunkie

New Member
Hi there,

anyone knows if its possible to use the USART ports with transmission rates less than 4.8kbps which still running the processor at 40MHz?

Thanks!
 
It depends if you want synchronus or asynchronus mode.
For asynchronus mode, the minimum speed is 2.44K Baud
For synchronus mode, the minimum speed is 39.06K Baud.

Why do you want such low speed anyway?
 
I need the speeds to be down because i'm using the a radio module to communicate. THe maximum speed of the receiver is 4800kbps..

on another note, is this the best way to transmit and recieve serial data to another pic? or have i chosen the wrong route?
 
jfunkie said:
I need the speeds to be down because i'm using the a radio module to communicate. THe maximum speed of the receiver is 4800kbps..

on another note, is this the best way to transmit and recieve serial data to another pic? or have i chosen the wrong route?

You need to implement some kind of encoding, Manchester Coding is the type usually employed. The limitations of the TX/RX modules prevent you sending straight RS232 - although if you invert it you can get away with it. This means either a hardware inverter between PIC's and modules, or using a software UART at each end - which would also allow you to use any speed you require.

Be aware that using Manchester Coding, or another type, will slow the data transfer down - something like 50%.
 
lost... :oops:

confused here... you mean i can't connect the pic directly to the tx/rx module? It accepts CMOS/TTL inputs..
 
jfunkie said:
lost... :oops:

confused here... you mean i can't connect the pic directly to the tx/rx module? It accepts CMOS/TTL inputs..

The 'resting' output from the UART is high, but the modules can't transmit a DC level - this corrupts the data, as the received ouput goes low (rather noisely) after a number of milliseconds.

As the UART polarity is fixed (it's designed to be used with a MAX232 or similar), you can't connect it to the modules without inverting it. It's also a bad idea to send plain RS232 over a radio link.
 
ahhh... i realise whats gone wrong.. :oops:

i already have an IC doing the conversion from RS232 to manchester coded data..

so that would mean that i can just output the data from the PIC in rs232 eh..?
 
jfunkie said:
ahhh... i realise whats gone wrong.. :oops:

i already have an IC doing the conversion from RS232 to manchester coded data..

so that would mean that i can just output the data from the PIC in rs232 eh..?

Yes, that solves all your problems :lol:

You just need to supply the encoder chip with the correct baud rate (and polarity - I would expect it to be simply pin to pin from the PIC?), it should be included in the application note with it.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top