How to apply reception using P16F873A with address detection

Status
Not open for further replies.

ProjecterF

New Member
The project need address detection when receiving the data. I read through the data sheet of the P16F87xA and knew that the 9-bit receiving mode can be set up to achieve this. But I still don't konw how to apply it in the program. Could anyone can tell me in details?Appreciate
 
Re: How to apply reception using P16F873A with address detec


What are you talking about?, RS232 or what?.
 
ProjecterF said:
I mean recieve the data from the 75176 using the Rx pin of the pic controller.

There's no address detection in hardware, you need to do it in software. The UART is designed for RS232, NOT RS485.
 
ProjecterF said:
So could you please tell me how I can do the address detection in software. Appreciate.

You first need to decide on the communication protocol you're going to use, and the size of 'packet' you will be sending.

Assuming you use a two byte packet, then the first byte will be the address, and the second the data. Simply read both bytes into two GPR's, and check if the address is correct - if not then throw both bytes away.

In practice it won't be as simple as that, you need a 100% way to detect the start of a packet, and probably checksum bytes as well?.

There may well be RS485 protocols commonly used?, I've no idea I've never used it. Bear in mind it is essentially a crude networking system, so you've got to account for collisions etc.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…