RFID project, Serin command, Baud rates/parity issues?

colinsmurph

New Member
Hi I haven't used serin much and it could all be very obvious? but I've been beeping this reader for over 8hrs now : )

The plan is to have 4 jigsaw pieces with RFID cards inside, when the correct part approaches its place (different RFID reader behind each space) it will trigger a sound.

I'm using a GP25 125kh RFID reader (never used RFID before) ...
These are supposed too be good for 25cm range....
outputs ASCII (RS232) 9600, No parity, 8bits, 1 stop bit.
format is -
STX(02 Hex)................I think this is the start quantifier? (not used)
Data (10 Hex chars) .....I think this is my data string?
(CR) (LF).....................Carriage and Line return? (not used)
ETX(03 Hex)................I think this is End of data? (not used)

The reader simply TX the serial string as and when a card is presented onto pin C.1
My scope says C.1 is at 0v and goes high on TX


Question/1
If set too M8 default frequency its a bit garbled and misses the serial string completely 80% of the time at baud N9600_8
If set too M16 frequency its garbled at N9600_16 but ...........
works fine at baud N9600_8 ?? is this because of an apparent speed double?

Question/2
I bought cards with no numbers written on... Each way produces one of 2 unique 10 digit number for the card.
Should use N or T parity ?
from what i have read....RS232 implies Idle high? it idles at 0v? does this matter?

Question/3
I need to check if one of 4 cards is present and (ignore) the 3 false cards, Is there anyway of taking the data from my code for later comparison? or do I need too use Hserin?

CODE
#picaxe 28x2
#terminal 9600
' Converted by X2 Conversion Wizard Version 2.0.5 (2010r4.1)

let dirsB = %00000000
let dirsc = %00000000
let dirsa = %00000000
let adcsetup = 0

setfreq m16
symbol RFID=c.1
symbol RFIDbaud=N9600_8

main:
bptr=28
serin [10000,main],RFID,RFIDbaud,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptr,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr

bptr=28
for b0=1 to 10
b1=@bptrinc
b1=b1-29//10
sertxd(#b1)
next b0
sertxd(cr,lf)
goto main
 

Goeytex

Senior Member
RS232 implies non inverted serial or T9600. The only thing i could find is minimal datasheet that indicates there should be a 4K7 pull up resistor on the serout out line from the reader. This will be the serin on the Picaxe. Did you place a 4K7 pullup resistor ?

DATASHEET
 

colinsmurph

New Member
RS232 implies non inverted serial or T9600. The only thing i could find is minimal datasheet that indicates there should be a 4K7 pull up resistor on the serout out line from the reader. This will be the serin on the Picaxe. Did you place a 4K7 pullup resistor ?

DATASHEET
**** yes very minimal data sheet***
Although Core are a fantastic firm to buy from, they went out of their way calling up another customer too see when they needed their GP25s....and managed too sort out 4 of these readers that were for short notice,
for me.

Yes I did try the pull up on Green (data) initially because I was going to use "Card present" on ORANGE wire to trigger the interrupt so I know which of the 4 card readers I am receiving data from, but had no joy with ether.

I tried again just now... but no joy seems too be held low even with the 4.7k.

But reading the manuals for the reader further implied it was an internal 4.7k pullups?
And for RS232 card present is disabled.

I realised all i need too do is find one bite that is different the 8th bit was a different value on each card....
Here is my current cheat...(working but dirty code)


#picaxe 28x2
#terminal 19200
' Converted by X2 Conversion Wizard Version 2.0.5 (2010r4.1)
pause 2000

let dirsB = %00000000
let dirsc = %00000000
let dirsa = %00001111 ;***set A0/1/2/3 too outputs.
let adcsetup = 0

setfreq m16
symbol RFID=c.1
symbol RFIDbaud=N9600_8


main:
bptr=28
serin [10,main],RFID,RFIDbaud,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptr,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr
bptr=28
for b0=1 to 8 ;***changed too 8 from 10 so I check a uniuqe single didget off the cards***
b1=@bptrinc
b1=b1-29//10 ;***converts Hex too decimal 0-9
sertxd(#b1) ;***output current b1 Value
next b0
sertxd(cr,lf) ;***send return/line feed too terminal too keep display tidy

let B2 = b1 ;***read the 8th number into b2
if b2 = 1 then goto led1 ;***light the appropiate LED
if b2 = 3 then goto led2
if b2 = 7 then goto led3
if b2 = 9 then goto led4

Led1:
high a.0
pause 250
low a.0
goto main

led2:
high a.1
pause 250
low a.1
goto main

led3:
high a.2
pause 250
low a.2
goto main

led4:
high a.3
pause 250
low a.3
goto main
 
Last edited:
Top