Experimenting with IR Remotes using a PIC running BoostC Project

From OpenCircuits
Revision as of 15:52, 21 December 2008 by Russ hensel (talk | contribs) (New page: = Experimenting with IR Remotes using a PIC running BoostC Project = '''EARLY DRAFT - NOT READY''' *Name: Experimenting with IR Remotes using a PIC running BoostC Project *Status: earl...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Experimenting with IR Remotes using a PIC running BoostC Project


  • Name: Experimenting with IR Remotes using a PIC running BoostC Project
  • Status: early draft -- do not read
  • Technology: PIC microcontroller, slavaged IR reciever, running with code in BoostC
  • Author: russ_hensel ( where you can find an email address to reach me )
  • Summary: A PIC16F877A project that reads IR remote controls. Runs with a PC running a terminal program.
  • Last revision Dec 21 2008 – Early Draft.
  • Download: see section below.

Platform: PIC16F877A using BoostC connected via rs232 to a PC running a terminal program, or as an alternative running a Java program developed especially to control the PIC ( still under development ). The PIC chip is supplemented with a dual op amp connected as two schmidt triggers, there is of course a stepper motor.




Parts -- this is not up to date, working on it

Part Details
Power supply Not shown, 5 volts, you can use a higher voltage with a voltage regulator. There is a suitable power supply in the PIC based Stepper Motor Dancing Analog Clock
PIC16F877A My favorate 16 series part, relatively lots of memory and pins. Bigger than you need, but only about 8 bucks. Try with an 18 series part, should not be hard and will leave you more up to date. Let me know. Other parts of the PIC circuit not discussed here.
Power supply splitting resistors, form a pseodo ground at about 2.5 volts. 100 more or less
RIN about 5 to 10 K
RFB feedback resistor should be about 4 times higher than the input resistor

Command Interface

All commands ( except stop should be terminated with a carriage return ) Note that the command interface is not very smart, giving parameters that are out of range my blow the whole program up. If so reboot the PIC. Do not send a new command ( except stop ) until earlier commands have been completed ( actually you can get ahead some if you are careful )

Command Code Notes, PIC Response
Report version v<cr> Version of the PIC software something like:

Serial Stepper Test ver July 4 2008

Reset r<cr>

reset the counters and the log of the encoder. Response something like "Reset Count"

Log report l<cr> Report the log of data. A series of binary numbers, comma delimited.
Report on all parameters r Delimited by commas something like:
Position of the encoder p<cr> report the position of the encoder, and other counts of encoder activity.
Stop ! Should almost immediately stop long running commands of which there are currently none. Response Stopped.
Other, not understood commands xxx Responds with "!Bad Command = xxx" if the command is not understood.

Notes on terminal program set up.

  • Baud rate should be 19.2K 8N1
  • Most terminal programs can be set to treat a carriage return as a carriage return line feed. Do it.

Some terminal programs will not transmit in lower case ( all our commands are lower case ) unless specially set to do so. Set it to allow lower case.

Microcontroller Program

Design =


The zip file contains the entire source bootst project. Unzip into a directory and open in source boost. Set the target to 16F877A. See the comments in the program header for other setup before compiling. After compiling my compiler reports something like:

Memory Usage Report

  • RAM available:368 bytes, used:248 bytes (67.4%), free:120 bytes (32.6%),
  • Heap size:120 bytes, Heap max single alloc:95 bytes
  • ROM available:8192 words, used:1239 words (15.2%), free:6953 words (84.8%)

The program seems to be safely under the 2K free compiler limit.

Other Things to Try


  • 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

This program uses my: Serial Communications Library -- BoostC and 16F877A

More information on serial communications with microcontrollers: Microcontroller Serial Communications Articles

A free terminal program, I like this much better than hyperterminal: Welcome to our Free Download/New Products Page! http://www.rs485.com/psoftware.html

BoostC – I think the free version is enough to compile the program: SourceBoost Technologies http://www.sourceboost.com/


pending, not at: Version 1 zip file: StepperTest_v1.zip

Comment, Questions, Contributions?

Email me russ_hensel, or use the talk page for this topic. All feedback is welcome.