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.

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

ProjecterF said:
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

What are you talking about?, RS232 or what?.
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top