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.

Synchronous RS485 Transfers

Status
Not open for further replies.

Timmymna

New Member
Hi All :)
I am currently trying to create a simulator with a PIC, I have to output synchronous data via two RS485 connections, one data, one clock. I am having trouble working out if a PIC is the right option for the communication side of things.

I need to clock out the data at 1.0152MHz, as I've only used asynchronous transfers before I'm having a little trouble working out if this is possible, the data sheet refers to generating a baud rate, would I need to set this to give a baud rate of 1015.2? I've read that 9600baud=9600Hz.

This is completely wrong but should I be trying to set SPBRG to around 2.94, then using the equ baud rate for sync is Fosc/(4(X+1)) where x is spbrg 0 to 255, where it will either have to be 2 or 3, also assuming 16MHz osc

If this rate can't be obtained from the PIC can I use an external oscillator to give the correct frequency or should I look for an external chip which can implement all of the transmitter side and keep the PIC for generating the data?

Thanks
 

Timmymna

New Member
Thanks for the reply.
The simulator has to be as close as possible to the real thing and that's the rate it chucks out the data.
I think I must have miscalculated that last bit as I've done it again and got the value I need.
If anyone wants to double check. Baud rate fomula, Fosc/[4(n+1)] using 16bit brg, I get value of 3939 for n. With 16MHz should give a value of 1.015228MHz

I was originally going to use the PIC24FJ64GA002 on the 16bit demo board from Microchip but I had overlooked that it only contains a UART rather than a USART.
The simulator also uses a checksum, another reason for that PIC as it contains a hardware CRC generator but now that's down the pan
Can anyone recommend a PIC with a USART and CRC generator? Trying to keep as much as possible on the one chip.

Thanks :)
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top