??? 05/25/05 18:54 Read: times |
#93905 - Some hints! Responding to: ???'s previous message |
read_code: mov r0,#08h setb card_in;missed in your code jnb card_in,read_code ;wait for card clr eye_on ;turn on power to ir led and ir diode pair lcall delayhs ;skip the white part read1: setb card_in;missed in your code jnb code_in,add_one setb card_in;missed in your code jb code_in,add_zero lcall skip_read ;4 milisec delay loop dec r0 cjne r0,#00h,read1 ;read 8 bit djnz r0,read1;use fully from 8051 instruction set mov a,bar_code ;read the result mov code1,a ;prepare to send mov code1,bar_code ;use fully from 8051 instruction set setb eye_on ret send_code: mov a,code1 lcall bin2dec lcall phat ret phat: clr ti mov sbuf,a jnb ti,$ ret thu: jnb ri,$ mov a,sbuf clr ri ret ;=================================================== add_one: mov a,bar_code rl a add a,#1b INC A;use fully from 8051 instruction set mov bar_code,a lcall skip_read ret add_zero: mov a,bar_code rl a add a,#0b ;use fully from 8051 instruction set mov bar_code,a lcall skip_read ret ; start: mov a,#00000000b CLR A mov code1,a lcall init_baud tiep: lcall read_code lcall send_code lcall delayhs ajmp tiep ret ;IT IS EXTRA end |
Topic | Author | Date |
decoding code 39 with 89s52 | 01/01/70 00:00 | |
Some hints! | 01/01/70 00:00 | |
do I still have to setb card_in | 01/01/70 00:00 | |
Oop ! i goofed off | 01/01/70 00:00 | |
8051 inputs | 01/01/70 00:00 | |
thanks i saw the point![]() | 01/01/70 00:00 |