I’m actually seeing some results from my Light Programmer. I’m reading a photoresistor using the analog comparator on an ATmega168. Check out my previous post about the hardware, then join me after the break to see what I changed to get things working, and to see the demo video.
I’ve been working on a way to push data into a microcontroller using a computer monitor (or smart phone) which flashes black and white. I’ve done some preliminary tests using one photoresistor read by an ATmega168 analog comparator circuit. The results have been mixed. Continue reading
I haven’t put much time into the light-based programmer I was working on. But I did get some advice from Devlin Thyne who pushed me in a different direction on it. He suggested I use Manchester Encoding which only needs one input. It’s a method of rolling the clock signal and data into one. But before I do that, I’m going to switch over to using the AVR Analog Comparator hardware. It’s an easy way to get a 1 or 0 out of an analog input. See my simple example after the break.
On Thursday I shared the start of the hardware side of my new project. I want to use flashing squares on a computer monitor to program a microcontroller via two photoresistors. I’ve been thinking of how to control it in a way that is useful and ended up drawing this somewhat elaborate flow chart.
Of the two photoresistors, one serves as a clock signal (PR1) and the other serves as a data signal (PR2). My program flow will loop until a low level is seen on the clock, then it will loop until it see a high level on the clock. At this point PR2 will be read to pull in a 1 or a 0. Along the way I’ll watch for a timeout, at which point I’ll do some data processing and then exit.
Hopefully this will be a robust setup. It should mean that timing is not an issue from the microcontroller side of things. The next problem will be to write a web interface that is used to do the actual programming. I think this will prove a bit tougher, but we’ll see.