Programming the code for receiving binary data

Skillet49

Senior member
Aug 3, 2007
538
1
0
I'm working on a senior design project and the only part of our project we have left to finish is the code for the receiver.

We are using a PIC12F683 chip and at the moment we are transmitting serial data with the NRZ(L) standard.

We are trying to write the code in C to receive the data, but we don't exactly know where to start.

Does anyone have any experience programming in C for such a receiver? I can't imagine the code being super complex, but we are a little dumbfounded at the moment.

Thanks
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Assuming the data is coming in over a serial port, you need to have a method that reads the I/O buffer for the post.

When to read the buffer can be interrupt driven , polling or just hanging a I/O read command to the port with an unlimited timeout.

Data will be placed into a buffer that you have assigned to the I/O read.
Copy that buffer to a new buffer as soon as the read completes and pass the new buffer (as a pointer) around; removing it when no longer needed