Download EXPERIMENTING with the PICBASIC PRO
Transcript
Experimenting with the PicBasic Pro Compiler Programs - SONY_ASM .BAS Sony, infrared remote control Receiver & ASM_RX.INC Assembler coded, Sony remote control Receiver . The include file ASM_RX .INC, achieves the same results as the previous, BASIC coded version, except that it-is a lot smaller, only 77 bytes, and is also only executable using a 4mHz crystal . Exactly the same variables are returned, namely, IR DATA, IR DEV, and IR VALID . In addition, two new defines have been added, to inform the subroutine as to which pin the infrared detector is to be placed, these are: Define Define IRIN PORT IRIN_BIT Port `Port for the IR detector Bit for the `Bit IR detector If these are omitted from the program, the default is PortA .4. As always, the include file must be placed at the beginning of your program to avoid any page boundary conflicts . +5 Volts Rl 4 .7k C1 C2 lOuf ~O .iuf 0 "' VDD RB7 MCLR RB6 RB5 4mHz RB4 Crystal RB3 1s 0SC1 RB2 RB1 RBO PIC16F84 RA4 la OSC2 RA3 C3 C4 RA2 2pf 22pf RA1 RAO V~5 S T s SFH506 L3_ 2 0 s e 7 H SFH 506-38 IR detector 2 .Vcc 3 .Gnd 6 vcc - 3 voul Gnd t e R2 470 Green LED ti To Serial LCD N9600 baud Figure 6 .1 . Sony, Infrared remote control Receiver . Section-6 - 3 211 1 .VOUl