Close

Codin'

A project log for Aurai - retrofit dumb air conditioners

Helping traditional air conditioners join the Internet of Things.

Thomas RThomas R 08/10/2014 at 16:520 Comments

I've started serious work on the code for the Spoke. Currently "done", and on Github.

* SPI framework

* AT25M01 SPI EEPROM

* DHT11 temp/humidity sensor

* Serial IO for debugging

Today, my aim is to get IR Output working. This will involve using one of the AVR timers in CTC mode to generate the 38khz carrier wave, then modulating that.

Remaining drivers to be written are for the NRF24L01+ radios and the ENC28J60 ethernet interface. I've saved the hardest for last.

UPDATE:

I got IR send working. I spent most of the time trying to get the CTC mode of Timer2 working - I didn't realize that even if you're outputting to OC2B, you still set the overflow value in OCR2A.

Also wrote some test functions that will be optimized out if they're not used.

Here's the implementation: https://github.com/rixth/aurai/blob/cef81dd1febec0986922c590f0a62e921f61ded1/firmware/spoke/src/IRSend.cpp

Discussions