| ??? 05/20/08 19:57 Read: times |
#154978 - CJNE Responding to: ???'s previous message |
I'm not sure you understand the CJNE instruction. The first compare jumps to VerMidiB on every value except 90H, that doesn't sound like what you want.
Jon
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 - Compare,jump if NOT equal
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
|
| Topic | Author | Date |
| 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 |



