After reading a few posts and doing a little testing with a DMM, I believe I have solved my questions concerning how a home thermostat works. First the posts/info that led to the conclusion:
RiteTemp Installation Guide (pg 17 - 4 Wire Heat/Cool No Pump)
JohnSAZ from EEVBlog:
Of course your thermostat may be
different but every one that I've ever
looked at worked the same (and your
color codes pretty much indicate an
industry standard setup).
Think of the thermostat as nothing
more than three switches. The "RH" is
your common. If you short "RH" to "G",
your blower fan will turn on. If you
short "RH" to "Y", the air
conditioning compressor will turn on.
If you short "RH" to "W", the heater
system will turn on. This could be a
gas burner solenoid, or relays to
energize resistive electric heaters.
If the unit is a heat pump, it will
turn on the air conditioning
compressor, but it will also energize
a reversing valve that will make the
freon run the other way around
(kinda).
Obviously you need to ensure that the
"G" and "Y" leads are NEVER turned on
at the same time. You also need to
make sure that the eater system can
not be turned on with the blower off.
Also, you need to make sure that when
the compressor turns off, it is not
allowed to turn back on for some time
(10 minutes? don't know the time limit
for sure). Also, higher quality
thermostats keep the blower running
for some time after the compressor (or
heater) has turned off to suck every
last Btu out of the system before
shutting down.
I grabbed my trusty DMM and confirmed that W, Y, G, and C all measure 30VAC+ when tested against RH (or R) - GND. When the system is running, G drops to 0.05 for both heat and cold (meaning the fan is running). W drops to 0.05 if the heater is running. Y drops to 0.05 if the Cooler is running.
I still need to research the appropriate timing for cooler/heater shutdown etc.
If anyone can think of any additional circuit protection outside of what JohnSAZ noted, please let me know. I am interested in adding a fail safe to the circuit design in case the unit fails. Not sure if relays in off positions during power outage would take care of business or not. Either way, I do plan on providing battery backup to the project just in case (IE. detect power failure, disable all controls).
I know this is old but might be helpful incase anyone stumbles apon it like I did.
I was having issues with overrun errors in my PIC18F452 communicating to a beaglebone black over USART. With quite a busy program going on in both the beagle and the PIC, there was lots of data being sent between the two constantly. After some amount of time after using the instrument the PIC stopped receiving all messages.
After being stuck and baffled by this for more than 3 weeks, I found this:
http://www.piclist.com/techref/postbot.asp?by=thread&id=%5BPIC%5D+PIC18+UART+stops+receiving&w=body&tgt=post
which described PIC code to handle and clear Overrun Errors:
if(OERR)
{
do
{
temp = RCREG;
temp = RCREG;
temp = RCREG;
CREN = 0;
CREN = 1;
} while(OERR);
}
if(FERR)
{
temp = RCREG;
TXEN = 0;
TXEN = 1;
}
Running this snippet every now and then in the PIC program allowed me to recover from occasional overrun errors without restarting the PIC.
Hope that helps anyone with similar issues
Best Answer
Have a look at Mecrisp Forth. I've been using it on STM32 microcontrollers.
It compiles to about 25K and is probably a lot of work (assembly language) to get it working on a PIC32. But if you do, you'll have a fast small Forth implementation. If you do, let me know.
It is worth a look as it is as cutting edge a Forth implementation as I've seen.