Editing Experimenting with IR Remotes using a PIC running BoostC Project
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
*Name: Experimenting with IR Remotes using a PIC running BoostC Project | *Name: Experimenting with IR Remotes using a PIC running BoostC Project | ||
− | *Status: | + | *Status: draft almost ready |
*Technology: PIC microcontroller, slavaged IR reciever, running with code in BoostC | *Technology: PIC microcontroller, slavaged IR reciever, running with code in BoostC | ||
*Author: [[russ_hensel]] ( where you can find an email address to reach me ) | *Author: [[russ_hensel]] ( where you can find an email address to reach me ) | ||
Line 12: | Line 12: | ||
Platform: PIC16F877A using BoostC connected via rs232 to a PC running a terminal program. The PIC chip is supplemented with a slavaged IR reciever. | Platform: PIC16F877A using BoostC connected via rs232 to a PC running a terminal program. The PIC chip is supplemented with a slavaged IR reciever. | ||
− | |||
− | |||
== Hardware == | == Hardware == | ||
Line 25: | Line 23: | ||
=== Schematic === | === Schematic === | ||
− | + | [[Image:pending.png | Schematic]] | |
− | Parts | + | Parts -- this is not up to date, working on it |
{| class="wikitable" | {| class="wikitable" | ||
Line 43: | Line 41: | ||
<!-------------------------------- | <!-------------------------------- | ||
|-valign="top" | |-valign="top" | ||
− | | | + | |Stepper Motor |
|I used a salvage one I had lying around. | |I used a salvage one I had lying around. | ||
<!-------------------------------- | <!-------------------------------- | ||
Line 49: | Line 47: | ||
| | | | ||
| | | | ||
− | <!-------------------------------- | + | <!--------------------------------> |
|-valign="top" | |-valign="top" | ||
|Power supply splitting resistors, form a pseodo ground at about 2.5 volts. | |Power supply splitting resistors, form a pseodo ground at about 2.5 volts. | ||
|100 more or less | |100 more or less | ||
− | <!-------------------------------- | + | <!--------------------------------> |
|-valign="top" | |-valign="top" | ||
|RIN | |RIN | ||
|about 5 to 10 K | |about 5 to 10 K | ||
− | <!-------------------------------- | + | <!--------------------------------> |
|-valign="top" | |-valign="top" | ||
|RFB | |RFB | ||
Line 65: | Line 63: | ||
|xx | |xx | ||
| | | | ||
− | <!-------------------------------- | + | <!-------------------------------- |
|-valign="top" | |-valign="top" | ||
|Q = crystal | |Q = crystal | ||
Line 81: | Line 79: | ||
|RRA2, RRA3 = Pull up resistors | |RRA2, RRA3 = Pull up resistors | ||
|10K more or less | |10K more or less | ||
− | <!-------------------------------- | + | <!-------------------------------- |
|-valign="top" | |-valign="top" | ||
|C_BP = By Pass Cap. | |C_BP = By Pass Cap. | ||
− | | | + | |Not on schematic, good idea to add one. A .01 to .1 mfd mica or other by pass cap, good at high frequency seems good. |
<!-------------------------------- | <!-------------------------------- | ||
|-valign="top" | |-valign="top" | ||
Line 97: | Line 95: | ||
|PUSH_BUTTON_SWITCH = Reset | |PUSH_BUTTON_SWITCH = Reset | ||
|Push to reset the processor. Mine was from salvage. | |Push to reset the processor. Mine was from salvage. | ||
+ | <!-------------------------------- | ||
<!-------------------------------- | <!-------------------------------- | ||
|-valign="top" | |-valign="top" | ||
Line 191: | Line 190: | ||
== Microcontroller Program == | == Microcontroller Program == | ||
− | === Design | + | === Design === |
− | |||
− | |||
If you look at the subroutine readIR( void ) you will see the heart of the IR receive. The routine loops each time checking to see if the output of the detector has changed. If it has not it adds one to the period, if it has it records the period and resets the period to 0. When the input goes quiet for a while it is taken as the end of the signal and we exit. Pretty simple. | If you look at the subroutine readIR( void ) you will see the heart of the IR receive. The routine loops each time checking to see if the output of the detector has changed. If it has not it adds one to the period, if it has it records the period and resets the period to 0. When the input goes quiet for a while it is taken as the end of the signal and we exit. Pretty simple. | ||
Line 212: | Line 209: | ||
I have tried to do a good job commenting the program, try reading them for more info. Comments on the comments, email me [[russ_hensel]]. | I have tried to do a good job commenting the program, try reading them for more info. Comments on the comments, email me [[russ_hensel]]. | ||
− | Note that the design blocks other activities in the software once the interrupt is triggered. This lasts about .1 seconds. I think the next itteration of the software should interrupt on each bit ( not just the starting bit ) and a timer should be used to time the bits. Then other tasks using either the main loop or other interrupts would not suffer much inpact. I will work on this at some future time | + | Note that the design blocks other activities in the software once the interrupt is triggered. This lasts about .1 seconds. I think the next itteration of the software should interrupt on each bit ( not just the starting bit ) and a timer should be used to time the bits. Then other tasks using either the main loop or other interrupts would not suffer much inpact. I will work on this at some future time, or perhaps you would like to do it for me? Add your material here. |
− | |||
Control of the software is via the serial communications library that I have described in other articles including [[Serial Communications Library -- BoostC and 16F877A]]. It yields a command driven interface with the following commands. | Control of the software is via the serial communications library that I have described in other articles including [[Serial Communications Library -- BoostC and 16F877A]]. It yields a command driven interface with the following commands. | ||
Line 284: | Line 280: | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Notes on the NEC Decoding === | === Notes on the NEC Decoding === | ||
Line 305: | Line 296: | ||
The program seems to be safely under the 2K free compiler limit. | The program seems to be safely under the 2K free compiler limit. | ||
− | == Other Things to Try | + | == Other Things to Try == |
+ | |||
+ | == Additions/Changes/Modification == | ||
* The 877A is way overkill for this project unless you make it do a bit more. Note that only 1 input pin ( with interrupt capabability ) plus the serial lines are really used. | * The 877A is way overkill for this project unless you make it do a bit more. Note that only 1 input pin ( with interrupt capabability ) plus the serial lines are really used. | ||
− | |||
− | |||
− | |||
== Possibly useful links == | == Possibly useful links == | ||
Line 329: | Line 319: | ||
== Download == | == Download == | ||
− | [http://home.comcast.net/~russ_hensel/OC/ | + | pending, not at: [http://home.comcast.net/~russ_hensel/OC/StepperTest_v1.zip Version 1 zip file: StepperTest_v1.zip] |
== Comment, Questions, Contributions? == | == Comment, Questions, Contributions? == | ||
Line 335: | Line 325: | ||
Email me [[russ_hensel]], or use the talk page for this topic. All feedback is welcome. | Email me [[russ_hensel]], or use the talk page for this topic. All feedback is welcome. | ||
− | [[category:projects | + | [[category:projects]] |