Then choose the comunication parameters.
The Example works with 38400 Bit/s 8,N,1
Your Tag will work with 9600 Bit/s 8,N,1
Choose this Parameters in the APG and all will be fine.
SW 2 + 3 of the RF01D had to be set to o by switch.
The receive Routine works interupt driven.
Every Byte that was received in the interupt routine increases this counter.
Every Byte You read out with: bytex=getchar();
decrease this Counter.
When all received Bytes was processed the routine was not called again, until a new byte was received.
I saw an error by me:
False: getchar();
Right: bytex=getchar();
That was an very simple example.
For Your solution I would take the received bytes into a string that is pointed by a variable.
When a new byte was received, You had to check it for 0x10 ( = ENTER ).
When the last Byte is 0x10, I would check the byte before it had to be 0x13.
When both Conditions are OK You have received a complete Tag and it could be printed out.
Some print options in "C" must have a 0x00 at the End of the string.
Possibly You have to insert that.
After printout You can set the pointer variable to 0.
So the String is ready for the next card.
my tags contains 10 digits on their serial numbers
So I would prepare the datax variable for 15Bytes ( = 1 complete String + CR/LF + 0 +2 spacer )
unsigned char datax[15];
unsigned char datapoint=0;
The spacer is not a must, but Codevision overwrite the next variable without warning if the pointer address it.
That could be a problem if 0x10 or 0x13 wasn't received correctly.
You see some traps You can get in.
The interrupt receive buffer can be lower. I think 25Bytes are enough ( 2 complete Strings ).
Additional I would take a clock into the "string" Routine.
When ( e.g. longer than 1s ) no additional Bytes in the string -> Reset the pointer variable.
That could be done by a timer that increases a variable.
When a value was exeeded the Pointer had to be set to 0.
This avoid trouble, when a string wasn't received complete and the next string is coming in.
Additional Explaination:
The bytes 0x30,0x31,0x38 and so on are the ASCII Code of the Number Characters.
So You can print them out directly.