; Wireless Tracked Vehicle ; Remore Transmitter Part ; Author: Santanu Das ; Date of Creation with ATtiny2313A: 30th May,2021 ; MCU Clock: @1MHz ; Pin configuration ; Inputs .EQU InKey = PINB .EQU LeftIn = 0 ; Red Pin PORTB.0 .EQU BkwIn = 1 ; Green Pin PORTB.1 .EQU HaltIn = 2 ; Blue Pin PORTB.2 .EQU FwdIn = 3 ; Red Pin PORTB.3 .EQU RightIn = 4 ; Green Pin PORTB.4 ; Outputs .EQU RedPin = 3 ; Red Pin PORTD.3 .EQU GreenPin = 5 ; Green Pin PORTD.5 .EQU BluePin = 4 ; Blue Pin PORTD.4 ; GPR's usage ;=============================================================== .DEF BCD0 = R2 ; Packed BCD numbers .DEF BCD1 = R3 ; to be stored .DEF BCD2 = R4 ; after conversion .DEF OprNim = R5 ; Defining Non-immediate Operator .DEF Temp = R16 ; Defining Temporary Data Register .DEF Counter = R17 ; Defining Operator .DEF OprIm = R18 ; Defining Immediate Operator ; 16-bit operator .DEF Opr16L = R24 ; Defining 16-bit Operator .DEF Opr16M = R25 .INCLUDE "TN2313ADEF.INC" ; ATtiny2313A .ORG 0x0000 RJMP Initiate ; Power On Reset .ORG 0x0015 Initiate: ; Stack pointer Initialization ; *** Only SPL as it has only 128 Bytes of RAM LDI Temp, LOW(RAMEND) OUT SPL, Temp ; Port Direction ; Port D output LDI Temp, 0xFF OUT DDRD, Temp OUT PORTD, Temp ; Port B.4 - B.0 Input (0b1110 0000) LDI Temp, 0xE0 OUT DDRB, Temp ; Initially RGB LED Off LDI Temp, 0x38 OUT PORTD, Temp ; Read inputs ReadInputKey: SBIC InKey, LeftIn RJMP ToggleRed SBIC InKey, BkwIn RJMP ToggleGreen SBIC InKey, HaltIn RJMP ToggleBlue RJMP ReadInputKey ToggleRed: RCALL DL_500ms LDI OprIm, (1<