my first PI op-code program is running in the target board.



Code:
CMD_NOP ; 0 +1 CMD_JMP, 0, 4 ; 1 +3 ; 4: loop: CMD_XOR, $20+PI_Out2, 1<<PI_TX_ ; Toggle Transmit Pulse Signal CMD_RETI CMD_RETI CMD_JMP, 0, 4 ; jmp loop CMD_EOF



CMD_NOP ; 0 +1 CMD_JMP, 0, 4 ; 1 +3 ; 4: loop: CMD_XOR, $20+PI_Out2, 1<<PI_TX_ ; Toggle Transmit Pulse Signal CMD_RETI CMD_RETI CMD_JMP, 0, 4 ; jmp loop CMD_EOF

; Timer/Counter2 Output Compare Match interrupt request service routine
ISR_TIM2_COMP:
out TCCR2, PI_TCCR2 ; (1) disable timer 2
; External INT0 interrupt request service routine
ISR_EXT_INT0:
_next_cmd:
; Load command
ld ZL, X+ ; (2) get command
; Jump to command vector
add ZL, PI_CmdVec ; (1)
ijmp ; (2) + (2) for another rjmp in the command vector



; Timer/Counter2 Output Compare Match interrupt request service routine
ISR_TIM2_COMP:
out TCCR2, PI_TCCR2 ; (1) Disable Timer2
; External INT0 interrupt request service routine
ISR_EXT_INT0:
_next_cmd:
; Load command
ld PI_Cmd, X+ ; (2) get Command
ld PI_Param, X+ ; (2) get Parameter
; Jump to command vector
ldi ZL, low(Cmd_Vector) ; (1)
add ZL, PI_Cmd ; (1)
ijmp ; (2) + (2) for another rjmp in the command vector




The idea is a result of lack of money and means. And of course, you won't have an instrument in the field.).
).



Leave a comment: