timothyjackson said:Hello all.
Silly little queries. Trying to understand how to make IR modulated signal transmission and reciever. Using Nigel Goodwins Tutorial 5.
In Read_pulse section/routine, its starts with "clrf LoX", clearing file register (i.e. make 0) LoX,,,,
what is so special about this file register?
Does it make the entire register 00000000?
The third line with the routine is "goto $-1" I can't find this labelled routine anywhere. Is this a special trick in PIC programming. ?
timothyjackson said:The third line with the routine is "goto $-1" I can't find this labelled routine anywhere. Is this a special trick in PIC programming. ?
timothyjackson said:thankyou both.
I understand these now.
With the Prockeys routine (same tutorial), flags2, new is tested, if set the device code id matched....then button matching continues to activate the correct LED output. My question is: in the IRread sub routine, I cannot find anywhere which sets the flags2, new bit. OR, is this flags2, new, bit automatically set when any bit in the flags gpr is set?
furthermore... its seems the LED is toggled on and off first...Have I made a mistake in thinking this. If I wanted to just activate the appropriate LED, I could just skip this and move to the the correct Key "?" (i.e. 1 to 3) routine? (I want my LEDS to be normally off, and illuminated for 5 seconds according to the code recieved...
timothyjackson said: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?
timothyjackson said:Nigel. you have no idea how much I trust/appreciate your replies.
I guess, the next thing is to simulate this in MPLAB?
If thats OK, buy a development board, and burn a chip, and see if it works?
I'm going to get development boards from mikroelectronica;
? or should i do this another way?
Nigel Goodwin said:If you've got veroboard, you can simply build my tutorial boards, they are more versatile than development boards as you can add new ones easily. Also cheaper than buying boards
Personally I never use MPLAB, I just use the MPASM assembler.
timothyjackson said:Nigel Goodwin said:If you've got veroboard, you can simply build my tutorial boards, they are more versatile than development boards as you can add new ones easily. Also cheaper than buying boards
Personally I never use MPLAB, I just use the MPASM assembler.
I can't download your tutorials. My pc comes up with an error missing .dll file. I emailed you to the address on your tutorials site a few days ago. Would love to see your tutorials. Is it possible to email them in another format?
MPASM, where can I donwload that from?
timothyjackson said:Both your modified code programmes were loaded into my MPLAB (never used it before). Both programmes built successfully. I have a few queries:
1.) _config 0x3D18
What is this? Within MPLAB it has a ";" preceeding this, therefore it acts as note?
2.) In the Receiver code, one error was to do with the cblock command: "warning [205].....Found directive in colomn 1"
I deleted a few of the GPR´s not required i.e. "lastdev", "lastkey" - seems to have removed this error`(doesn´t come up on "buildall" instruction anymore)
3.) "error section`org-1´ cannot fit the absolute section. ??I changed "org 0x0004 to org 0x0005, as per the transmitter code, and these seems to have stopped the problem.
timothyjackson said:thanks nigel. Ploughed through my notes again today (getting ones head around things), and these still concern me:
1.) The Configuration bit. What have you specified here: (I just want to understand this on a basic level- I imagine, like with the status/interupt/option configuration method, you have specified this number to set up the fuses?
_config 0x3D18
2.) I don´t understand the "programmer" stage (i.e. PIC Start PLus, PIC Kit1 etc). Is this the language which the software (MPLAB) uses to burn the information into the chip?
3.) I want to get a development board from Mikroelectronica, do I need to be careful about which "programmer" they can be used with? Im a little lost here.
4.) In simulation of the code (Your modified IR circuits), the simulation will keep looping at a stage i.e. waiting for a signal to be received, how can I simulate a recieved signal, so that the rest of the code can be simulated? I understand that you don´t use MPLAB, and therefore don´t expect you to know.
5.) OK. So, the flow chart is done.......the code is done......the code is built succesfully......the code simulates succesfully........what next?
Is it. Assemble code > Programme code into chip > test chip.
6.) Is there a method of testing the circuit in a chip? rather than blowing a heap of chips before getting it right? Or, is there a re-programmable chip option (16F628)
OK. Enough for now. Asked you loads of stuff already. Just one last one.
Any good links for studying howe to do PWM, I want to learn how to fade LED´s on and off slowly using my new found PIC understanding?
timothyjackson said:4.) "For development you would use a FLASH/EEPROM chip (like the 16F628" This means I can constantly reprogramme to perfection. Once this code & circuit are perfected, is their a version of this chip which is not FLASH/EEPROM, which is cheaper, but has the same operational functions barr the flash/eeprom?
6.) Where is the best place to purchase PIC´s in the UK (i.e. low minimum order quantities etc.) Was giong to use DIgikey in the states - I heard service is top notch.
timothyjackson said:Thanks Nigel.
Back from skiing now.
Which development board to recommend me to purchase "prefer to buy, not make".
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?