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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/15/03 18:08
Read: times


 
#45561 - RE: Velocity tracker using an 8051
Responding to: ???'s previous message
Three points immediately:
1.) You don't need to ABSOLUTELY locate all your variables. Let the assembler do that for you.

2.) INTERRUPT routines should end with RETI, NOT RET.

3.) MOST character LCD modules use the 44780 commands and programming, though YMMV.


I haven't the patience to read the whole thing for free, but what doesn't work ? I can see big problems with the interrupt stuff, and your timer code seems odd. The range and accuracy of the system means that the maths can be simplified with look-ups, and you end up with simpler main code.

Bear in mind that the maximum precision, in air is about 1% of reading MAX.


TMRINTR1: ; timer 1 interrrupt subroutine
MOV TH1,#CONST1 ; reload counter of timer 1 , higher byte
MOV TL1,#CONST0 ; reload counter of timer 1 , lower byte
SETB TR1 ; start counting again

; ^^^^Why ? you haven't STOPPED counting yet !



MOV A,R1 ; mov the metre counter to the acc and
ADD A,#01H ; increment it ,
MOV R1,A ; this is done so as to make checking of overflow possible , i.e. carry will occur

; why not try this, its faster:
CLR C
XCH A, r1
INC A
XCH A,r1
; I woudn't do a range check in the interrupt if I can help it. Speed Speed.

RETI
; Go back to the calling program

NO ! return from interrupt.

Steve



List of 8 messages in thread
TopicAuthorDate
Velocity tracker using an 8051            01/01/70 00:00      
   RE: Velocity tracker using an 8051            01/01/70 00:00      
      RE: Velocity tracker using an 8051            01/01/70 00:00      
   RE: Velocity tracker using an 8051            01/01/70 00:00      
   RE: Velocity tracker using an 8051            01/01/70 00:00      
      RE: Velocity tracker using an 8051            01/01/70 00:00      
         RE: Velocity tracker using an 8051            01/01/70 00:00      
         RE: Velocity tracker using an 8051            01/01/70 00:00      

Back to Subject List