Please Check this
Attention to all PIC experts (nigel).
I have modified some code (nigels tutorial 5) code. The application is basically 2 boxes, which communicate with IR, en/decoded using PIC. One box has 8 transmission buttons which each send different message. The reciever (other) box reads the code, and turns on a relevant LED for 5 seconds.
Attached are the 2 modified program codes: one for reciever; 1 for transmitter, and also a flow chart at the bottom (all .doc)
Im a few weeks into the world of PIC's, and I am scared about having made some errors. I guess, all these questions are geared to finding out if this will work? Please refer to the attached documants.
The Reciever (originally tutorial 5.3)
1.) __config 0x3D18 Does this set up the oscillator, and, setup the option_reg?
I don’t see how this set’s up the TMR0 or prescaling. Or is this a lookup file?
2.) I Have removed the EE_write routine; Both the “call” and the “routine” has been removed. EE_read has also been removed, as, the output ports are intended to be in logic 0 in normal & startup state. The “call” and the “routine” has been removed.
I removed these as the output ports were being “bsf” for 5 seconds [timeloop], and then “bcf”.
If am wrong, can you briefly explain why?
3.) Is this routine correct “LED_5sec”?
The Transmitter (originally tutorial 5.2)
1.) SW1 Equ 7 ;set constants for the switches
Are these commands assigning “switches” to relevant bits of porta?
2.)ProgUp Equ d'16'
This scares me a little. I deleted the 4 device prompts (vol up/down, prog up/down); switches now “movlw” from the But”x”, and this is transmitted. I think? Im not too sure about this.
I made these changes because I don’t need to achieve specific functions like volume up, etc. I just need each one of the eight buttons to turn on a relvant LED (using the BUT”x” id?).
Is this correct?
3.) Have I made any mistakes/oversights now that 8 switches are being used?
Looking forward to feedback
Many thanks to you all. Big thanks to Nigel.
