PDA

View Full Version : how synchronize with rfid reader



karellen
- 18th April 2009, 09:44
i have rfid reader module sending serial data 8n1 9600 baud at TTL format
and transmits 7 byte with one second cycle
i used serin2 and serin commads and received data and displayed them on display without synchronization data is changing and floats even it reads same tag
at proteus a make coomunication by simulating rfid reader as a pic628 sending 7 byte data like reader and
i will use hserin command
how can i synchronize pic877a with rfid reader which command must be used
at this kind of communication

mister_e
- 18th April 2009, 20:07
I must be silly, sort of, but I read your post again and again, I try to understand, I just can't :(

We will need more information, Is this more a ISIS problem or Code problem here?:o

karellen
- 18th April 2009, 21:12
not isis problem
it is code problem
how can i communicate pic16f877 with rfid reader module which sending data 8n1 9600 baud at ttl format

which command of picbasic must be used to receive this kind of data ?

mister_e
- 18th April 2009, 22:24
For the receiver
SERIN/DEBUGIN/SERIN2/HSERIN would work. Also possible and recommended to use USART interrupt to allow to do something else while there's no incoming data.

For the transmitter
SEROUT/DEBUG/SEROUT2/HSEROUT

karellen
- 19th April 2009, 08:53
i can receive data and show them on display
but i cant receive correct data
(i must receive $00,$05,$01,$1A,$01,$2F,$55)
and codes on the display changing and floating even i read same rfid tag
i know these serial commands i use them but i dont know how to organize them to receive bytes 8n1 9600 at ttl format

mister_e
- 19th April 2009, 09:44
HSERIN [HEX2 VAR1, HEX2 VAR2, and so on]

karellen
- 19th April 2009, 11:44
i cant try it with rfid reader may be tomorrow
but trying it with isis
as transmitter i use 628
as receiver i use 877a

can not receive with hserin and hserout
i write define s from the help of mcs
i can see the bilinks of sending data on isis but they are yellow
bu no received data on display

mister_e
- 19th April 2009, 17:58
post your codes, Include your config fuses, and a screenshot of your schematic here, we will have a look at this.

karellen
- 28th April 2009, 21:04
this is my code i receive data but these are not the data i must receive
i receive wrong bytes
at the help of picbasic rcsta is90h
at he data sheet of 16f877a address of rcsta is 18h
i made it 18h i receive no data
please help me

[SIZE="5"]
INCLUDE "modedefs.bas"
PORTC=0
PORTB=0
PORTD=0
TRISC=%11111111
TRISB=%00000000
TRISD=%00000000
@ DEVICE pic16F877A
@ DEVICE pic16F877A , WDT_on
@ DEVICE pic16F877A , PWRT_ON
@ DEVICE pic16F877A , PROTECT_OFF
DEFINE OSC 4
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 25
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_RWREG PORTB
DEFINE LC_RWBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 4

A1 VAR BYTE


RTAG
LCDOUT $FE,$80,"DIGITAL SIGN"
HSERIN 1000,JMP,[A1]
JMP
LCDOUT $FE,$C0,"TAGID=",hex2 A1
GOTO RTAG
/SIZE]

berke1984
- 6th December 2009, 15:13
INCLUDE "MODEDEFS.BAS"

'***********************DEFINITIONS*************** ************************
DEFINE Osc 4
'--------------------------------------------------------------------------------------------
'***********************SERIAL COMM DEFINITION**********************
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 19200

DEFINE LCD_DREG PORTb
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTb
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTb
DEFINE LCD_EBIT 3

cmcon=7
trisb=%00000010
trisa=%00000001

a var word
b var word
c var word
d var word
e var word

ANAPROGRAM:

hserin [hex2 a,hex2 b,hex2 c,hex2 d,hex2 e]
pause 50
LCDOut $fe, 1,hex2 a,hex2 b,hex2 c,hex2 d,hex2 e
pause 10

goto anaprogram

end