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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/20/08 17:39
Read: times


 
#154969 - Indirect addressing trouble (with midi)
Hello, I'm here again bothering you, and asking for help again...
I want to receive Midi Note data, and store every Note Velocity data in a ram address addressed by the Note value, I thought to use indirect address, placing in R0 the Note value... but I'm having some trouble, maybe I'm blind. Please, help me... The midi routines are ok, I tested putting the value in P2 in every step... SERI is serial interrupt. Thanks



SERI:
        PUSH ACC
        JB RI,LER
        JMP MidiEnd
LER:
        MOV A,SBUF
        MOV V0,A				;Buffers SBUF
        CLR RI

        CJNE A,#090h,VerMidiB	;Look for Note ON
        MOV MidiB,#1
        JMP MidiEnd
        
VerMidiB:
        MOV A,MidiB
        CJNE A,#1,VerMidiBVelocity
        ;MidiB=1 Receive Midi Note

RecMidiNote:
        MOV R0,V0				;Stores Midi Note in R0
        
        MOV MidiB,#2
        JMP MidiEnd


VerMidiBVelocity:
        MOV A,MidiB
        CJNE A,#2,MidiEnd
        ;MidiB=2 Receive Midi Velocity

        MOV A,R0
        ADD A,#127				;ADD 127 to store in upper ram
        MOV R0,A
        
        MOV @R0, V0				;Should store Velocity (V0) in addressed memory by Midi Note value


        MOV P2,@R0	;<<==== here, P2 dont receives the value back
        
        MOV MidiB,#3




MidiEnd:POP ACC
        RETI



List of 18 messages in thread
TopicAuthorDate
Indirect addressing trouble (with midi)            01/01/70 00:00      
   Not sure I understand            01/01/70 00:00      
      Midi            01/01/70 00:00      
         CJNE            01/01/70 00:00      
            90H is Midi Note ON command            01/01/70 00:00      
               Yes, appears bad            01/01/70 00:00      
   Very Strange!!!            01/01/70 00:00      
      Not strange            01/01/70 00:00      
         But is indirect address!?            01/01/70 00:00      
            You are right            01/01/70 00:00      
      It seems that 8052 is bad!            01/01/70 00:00      
   Some suggestions            01/01/70 00:00      
      Excuse me! But I dont agree            01/01/70 00:00      
         Don't blame the processor!            01/01/70 00:00      
            From time to time it happens...            01/01/70 00:00      
   check value of r0            01/01/70 00:00      
   Problem Solved!            01/01/70 00:00      
      full 'name' please            01/01/70 00:00      

Back to Subject List