Idea for learning IR remote...

vttom

Senior Member
I've been mulling over the idea of using the PICAXE to implement a learning IR remote for some time. And I just had my eureka moment.

I've had a lot of experience with combining a PICAXE with a SPI memory to collect data. The cool thing about SPI memories is that once you initiate a write (or read) you can just keep pumping the clock and data shifts in bit by bit until you tell it to stop.

So... What if you tell the PICAXE you're about to "learn" an IR remote code. This causes the PICAXE to initiate a write into the SPI memory at a particular starting address. Then the PICAXE waits for a transition on the IR input line. As soon as that happens, it starts clocking the SPI memory. If the IR input line is also directly connected to the data input on the SPI memory, then you will be sampling the IR code at regular intervals.

After a certain number of clock cycles, then the PICAXE will stop the write.

To recall the learned code, then the PICAXE initiates a read at a certain starting address and clocks the SPI memory at the same frequency used to record it. With the data output of the memory driving the IR transmit circuit, then the resulting output will be identical to the previously recorded input.
 

westaust55

Moderator
I've had a lot of experience with combining a PICAXE with a SPI memory to collect data. The cool thing about SPI memories is that once you initiate a write (or read) you can just keep pumping the clock and data shifts in bit by bit until you tell it to stop.

This is true to a limited extent.

Both SPI and i2c EEPROMS and SRAM chips have a paging system.

For example, considering Microchip devices, the 256k bit EEPROM devices have a 64 byte page. The 256k bit SRAM chip has a 32 byte page structure.

If you are “pumping out” data to the memory chip and reach a page boundary, then the next byte is written in byte 0 of the current page (ie the address rolls over) and not at the next sequential address (ie byte 0 in the next page).
 
Top