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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/22/06 21:40
Read: times


 
#128426 - Moving in the positive
Responding to: ???'s previous message
Mohammed,

Ok, we're moving ahead here! The code layout and comments makes things a lot easier!


MOV PULSES,#250 ; PULSES DESIRED
MOV A,PULSES
MOV B,#02H ; PCA TIMESOUT EVERY 500us ( HOWEVER two 500uS timeouts makes 1 pulse )
MUL AB
***********************************************
MOV .LOW(PULSES),A
MOV .HIGH(PULSES),B ; Now Pulse Counter Holds correct pulses needed

What are you trying to achieve here???
**************************************************
You multiply the value in PULSES by two then store the result in the low and high address of PULSES? From my interptretation, A (with a value of 250 * 2 = 0F4h) would get stored into PULSES and B (whose value is 01h) will get stored into memory location 0, which is R0. Not quite what you want to achive methinks.


Remember - the ramp will be exponential - 100 pulses at 1khz,100 pulses at 2khz etc, so the acceleration will increase. If you want a constant acceleration, you will need to compute the number of pulses per frequency range - is: 100 pulses at 1khz,200 pulses at 2khz etc. One possible solution for this is to use another table for the number of pulses and make PULSES a 16 bit variable.

Erik - I don't think there is too much code in the ISR. The OP has told us what cpu -P89C51RD2HBA at 25MHz if my memory serves me correct. Execution time I don't think is an issue at this point - remember get it working properly then optimise!




List of 41 messages in thread
TopicAuthorDate
PCA Problems            01/01/70 00:00      
   Problem or deisgn feature?            01/01/70 00:00      
      PCA upsetting Servo Ramp-up            01/01/70 00:00      
         How are you doing this?            01/01/70 00:00      
            more questions            01/01/70 00:00      
            How to connect Cool Edit            01/01/70 00:00      
               does not work            01/01/70 00:00      
                  Pulses generated ok            01/01/70 00:00      
            My Code            01/01/70 00:00      
               ther is your problem            01/01/70 00:00      
               Why are you...            01/01/70 00:00      
                  Assistance Please Russell            01/01/70 00:00      
               A suggestion            01/01/70 00:00      
   Minor Problem in Suggestion            01/01/70 00:00      
      I might have a guess            01/01/70 00:00      
      More comments            01/01/70 00:00      
         Thanks Eric n Russell            01/01/70 00:00      
            A two way street            01/01/70 00:00      
            Lost communication?            01/01/70 00:00      
            not a question of intelligence            01/01/70 00:00      
   This Code Works !            01/01/70 00:00      
      Much better with the comments!            01/01/70 00:00      
      explain a bit here            01/01/70 00:00      
      Moving in the positive            01/01/70 00:00      
         Russell you comment plz !            01/01/70 00:00      
            My comments            01/01/70 00:00      
               Guess you must be right !            01/01/70 00:00      
                  does not work !            01/01/70 00:00      
                     Make it work - thats your job!            01/01/70 00:00      
      Why disable interrupts            01/01/70 00:00      
         I thought the same about the interrupts            01/01/70 00:00      
      Cool Edit            01/01/70 00:00      
         re: Cool Edit            01/01/70 00:00      
            if not square waves - what did you get?            01/01/70 00:00      
               Cool Edit vs Digital Scope            01/01/70 00:00      
                  Cool edit            01/01/70 00:00      
                     Thank You !            01/01/70 00:00      
                     sample rates!!!            01/01/70 00:00      
   Will provide feedback            01/01/70 00:00      
   please help me about visisp52            01/01/70 00:00      
      discussed ad nauseam            01/01/70 00:00      

Back to Subject List