Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/30/07 05:44
Read: times


 
#140024 - Cant debug, explained + Code
Responding to: ???'s previous message


TL EQU 07Ch ;Vars location
TH EQU 07Dh
TS EQU 07Eh
LINE EQU 07Fh



MOV A,#0
MOV LINE,#0
MOV DPTR,#TEXTDB ;Points to TEXTDB (where I want to get the value)

START: MOVC A,@A+DPTR ;Get the value from TEXTDB

CPL A ;Invert value bits because my P0 is connected to a inverter
MOV P0,A ;Put the value to P0
CALL DELAY ;Wait some

INC LINE ;Increment LINE to get next value from TEXTDB
MOV A,LINE ;Copy LINE value to A so can be compared
CJNE A,#45,START ;Verify if is the last value, if yes, start again, else continue incrementing
MOV LINE,#0 ;Get first value again
MOV A,#0 ;Get first value again
JMP START ;Start again


DELAY: MOV TS,#3 ;Just a delay routine
MOV TH,#255 ;Im using a big delay by now
MOV TL,#255 ;see if it is working corretly
DTL: DJNZ TL,$
MOV TL,#255
DJNZ TH,DTL
MOV TH,#255
DJNZ TS,DTL
RET


TEXTDB: DB 00000000B,... +44 binary values
END


I want to build a skywriter, my 8051 has 8 leds connected to P0, i want the leds blink so fast when it is rotating it creates letters and drawings, the values to put in P0 is stored in a DB called TEXTDB, all values are in binary, but my code isnt running as i want, when LINE value is 26~45 it just reads 0's.
I made a test with TEXTDB as 1,2,3,4,5... and worked ok, I think is some bug. Have another way to put values in DB? Can I get it from another file?

Thanks.

List of 24 messages in thread
TopicAuthorDate
How to store data in 8051/DB command            01/01/70 00:00      
   More Detail            01/01/70 00:00      
      Data            01/01/70 00:00      
         DB            01/01/70 00:00      
            1k in db            01/01/70 00:00      
               depends            01/01/70 00:00      
                  starting to understand            01/01/70 00:00      
                     Yes            01/01/70 00:00      
                        better?            01/01/70 00:00      
                           Example ?            01/01/70 00:00      
                              need...            01/01/70 00:00      
                                 Thats it            01/01/70 00:00      
   some answers...            01/01/70 00:00      
      I got MOVC!            01/01/70 00:00      
         The datasheet is the cuestion            01/01/70 00:00      
         store the A contents away...            01/01/70 00:00      
   cant debug a problem...            01/01/70 00:00      
      First step            01/01/70 00:00      
         a skywriter...            01/01/70 00:00      
            well, if you copy crap,, you get crap            01/01/70 00:00      
      I always thought.....            01/01/70 00:00      
   Cant debug, explained + Code            01/01/70 00:00      
   I THINK i found the problem            01/01/70 00:00      
      Long lines            01/01/70 00:00      

Back to Subject List