hello, im working on a project that reads serial data from RFID scanner...... Now the problem is the serial data is unable to be fetched..... im using at89s52 microcontroller... the instruction
MOV A,SBUF
doesnt copy the sbuf data to the accumulator for further processing... the RI pin goes high on recieving data n its been cleared through programming..... the only problem is the data is not been copied to accumulator.....
plz help.... thnku.....
Check list
Is the port3 pin configured as input pin? (to configure port pin as input, SETB P3.0) Is the SCON register configured properly? REN bit must be high. Is the baud rate correctly generated? (to generate baud rate, configure one of the timer properly)
finally, Is data being received in RxBuf? to check this, just output the RxBuf data on any of the port and check the bits on port.
i hav tried as you suggested..... scon as 0x50(mode2) tmod as 0x20(timer1 autoreload) th1 as 0xfd (9600 baud rate)
also i hv also tried putting data on port0 yet having d same problem
the mov a,sbuf instruction is not being executed....
also i hv also tried putting data on port0 yet having d same problem Elaborate the problem. What did you get on Port?
why dont u try using the address of A reg instead? Reg A address is 0x0E0
MOV A, SBUF or MoV 0E0H, SBUF or etc..
show relevant code
"Not being executed", really? And would you mind explaining how you arrived at that rather wild conclusion?
why dont u try using the address of A reg instead? And how's that supposed to make any difference?
MoV 0E0H, SBUF
No such instruction in an 8051.
Really? And would you mind explaining how you arrived at that rather wild conclusion?
http://www.keil.com/support/man/docs/is51/is51_mov.htm
Look at the MOV dest_direct, src_direct
Blimey, looks like not actually having used 8051 actively in 10 years finally caught up with me. Sorry for that misinformation.
But there's something useful that came of it, too: at least it confirmed that my anonymous coward of a personal troll still has found no better use of her time than to monitor the forum for postings I might write.
Some Basic questions for you to understand your code:
1. RFID baudrate is set to 9600 ?? 2. Are you using polling or interrupt method to receive buffer??
copy the serial communication module code, so that solution accuracy will be high.
3) are you even checking RI 4) what happes if you do mov a,#77, mov a,SBUF
But there's something useful that came of it, too ...
I would respond in the same way to any such post that I happen to notice.
"the mov a,sbuf instruction is not being executed...."
The only way the mov a,sbuf instruction isn't being executed is if it isn't "hidden" behind some conditional expression.
But if the processor do reach that instruction, then the processor has no option but to execute it.
If you don't get the expected result in A, then that is because SBUF doesn't contain what you expect it to contain.
About baudrate - always verify your baudrate by _sending_ data and checking the baudrate of the transmitted data using an oscilloscope.
Are you sure that the "serial data" from this unspecified "RFID scanner" is actually in a format compatible with the 8051 UART...?
Not everything "serial" works with a UART...
eg, www.proxclone.com/wiegand.html