We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi friends,
this is part of the code used to read the binary data from a motorola Oncore gps timing RX (they do/did a version that can output 10Khz as well).
its got 4 errors so plz tell me what is bad
GetRx call readst ; read receiver data string iorlw 0 ; test W, 0 = checksum good btfss status,z ; if read error do not update lcd return ; Call again for second string call readst ; read receiver data string iorlw 0 ; test W, 0 = checksum good btfss status,z return ; if read error do not update lcd MOVLW 0x01 ; Clear LCD CALL cout CALL chkbsy movf day,w ;Send date call p_bin movlw '-' call dout movf month,w call p_bin movlw '-' call dout movf year_hb,w movwf hbyte movf year_lb,w movwf lbyte call bin2bcd call p_4 ; send 4 lsd from "R" reg to LCD movlw ' ' ; send space call dout movf hour,w ; send time return
i have no good ansewr for my problem i have got one bug but have not found anotehr
you pl help with other and give one each
Why? Don't you think school work is foor school students?
You need to do two things:
1. Use the assembler to show you the syntax erros;
2. Use the simulator to step through the code, and observe what happens.
In fact, you could do both of them just with pencil & paper and referring to the Instruction Set manual - Chapter 2 of the so-called "bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
The errors are blatantly obvious. A review of 8051 registers and instructions would be a good place to start.
all you need help with can be found in "the bible" and the specific questions are 'answered' in cahapter 2
Chapter 2 - 80C51 Family Programmer’s Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Erik
you will, of course need it all, so here are the links to all "the bible" Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
"you pl help with other and give one each"
And do you think this approach will be allowed when you have to sit your exams...?
my code complies now :=)
and i now put in coments to understand
but do you think it dorks?
MOV R4,A // load register wit a MOV R2,#6 // number of bits CharLoop: MOV A,R0 // load a agin MOVC A,@A+DPTR // ?????????? MOV P0,R0 // get next key INC R4 // add 1 INC R2 // again CJNE R1,#9,CharLoop // branch if 9 RET <pre/
You've never given even the remotest hint of what it is supposed to do, so how can anyone possibly tell whether it does that or not!
Most of your comments add nothing that is not directly obvious by simply looking-up the instruction in the manual. The whole point of commenting code is to explain what it is trying to achieve - not simply reiterating what is obvious from the instructions themselves!