-
First real usage !
11/27/2016 at 10:15 • 1 commentNope, not programming an µC yet, I started with the simpler APA102 protocol, and here is the result :
I currently test with 24.5 bytes per A4 sheet (4 start bytes, 5x4 byte for 5 leds, 4 bits stop)
Here is the strip I used :
Black means 1, white means 0, this way you read 0s when no strip is inserted. The signal is fed into the negative entry of the opamp, then the opamp will output 1 when light is blocked
As you may have noticed, the G5 (global luminosity for led 5 which also is a start byt for the led5 frame) is wrong and should start with 3 "1"s instead of 3 "0"s. Once this has been corrected, everything worked fine :)
-
First reason to celebrate !
11/26/2016 at 16:36 • 1 commentI received some opamps today (TI TLC2272), and a friend of mine whom printer is not as defectiv as mine printed a picture I gave him and.... it works !
Well, at least I could read the strip. I would need to read the opamp output at faster rate to be sure there is no false 0 or 1 that the mcu would read during transitions, but when pulled with an arduino, the result is clean !!
(if you ask, 'B', 66 decimal, is 42 in hexa ;) )
-
Making a better mask
11/20/2016 at 11:21 • 0 commentsI noticed this morning that the 0.5mm white paper that I used for the mask (cut into a business card) was not stopping the light from the leds. I made a new one with two pieces on aluminium foil on adhesive tape, and the result are way better.
Now I have to find a good printer to make a more opaque barcode, that will certainly help.
-
Comparator with hysteresis
11/19/2016 at 17:52 • 1 commentI found a documentationfrom TI about comparators with hysteresis. (http://www.ti.com/lit/ug/tidu020a/tidu020a.pdf). This combines a schmitt trigger (clean fast and clean transition) with a comparator (output switch does not need to occure at 5V/2, I can center it on the mean ouput of my diode.
I found a simulator on http://www.falstad.com/circuit/index.html and made a test :
The first AC voltage is noise (500Hz -+250mV), the second one is signal (2V DC +- 60 Hz 500mV)The AOP is set with asymetrical power supply (U- = 0V, U+ = 5V), the 200 and 300 ohm resistor generate the voltage at which the AOP will switch its output (5V * 200 / (200+300) = 2V), then some positiv feedback add hysteresis for a clean signal. Since the feedback is 0 to 5V and not -5V to +5V, this creates an asymetry and the low state is shorter than the high state. This can be compensated by lowering the 200kR, but I'm not sure it will cause trouble in my case. My signal seems to have few noise, I can also raise the feedback resistor to 1MOhm to reduce the effect.
Since the MCU will have a very high input impedance, it might be needed to add a resistor from the AOP output to the ground, as shown at the end of the page here : https://www.maximintegrated.com/en/app-notes/index.mvp/id/3616
I need to by an oscilloscope :)
-
Laser ?
11/19/2016 at 12:49 • 0 commentsRandom thought : if I replace the LED with a small cheap laser, I could get a higher light density (hence rising le the tension higher). On the other hand, that would go against the original idea to make an MCU programmer that you could built with part you may already have or could buy for cheap at local store.
Anyway, I ordered 10 laser pointer (for $0.16 each) on ebay. I'll try using them if I can't get the programmer to work with LEDs.
-
First analyse of the ouput signal
11/19/2016 at 12:23 • 0 commentsI made a quick setup with two phototransistors, two leds, some resistor, some piece of wood to align everything, some black strips printed on transparent paper, and a 0.5mm wide opening in some heavy paper as a mask. I tryed to tweak everything to get the best result I could, and made some mesurement (using an arduino because my oscilloscop is dead :( ). Here is the result :
I currently have two problems to solve :
-The levels are bad (when the resistor after the phototransistor is too low and the signal only raises to about 2.75V, it already too high and the signal only goes down to maybe 1.7V in some cases.
-The alignement of the two bit streams (data and clock) is poor : first clock (orange) starts about 1 period after the data signal, when it should be half a period.
Hald a period is 0.25mm, which is an acceptable precision for something that has been hand build, yet is not precise enough. On solution which would solve those two problems at once would be to widen the bands. But imagine you want to flash a 100 byte bootloader, that's 800 bits, and with the protocol overhead, you'll probably need to send about 1200 bits. With 0.5 bands, the paper strip will already need to be 1.2 meters long. I'll try to solutions that does not imply to double this length.
One thing is sure for now : I have two problems to solve, and I need to separate them and solve them individually so I can manage the complexity.
-
Reading a photo transistor with a voltmeter
11/19/2016 at 11:46 • 0 commentsI ordered some phototransistors, lots them, ordered again, and made this simple circuit :
If you read voltage between the phototransistor and resistor when the led cast light to the phototransistor, it read a low voltage (about 0.5V), when there is no light, it read almost 5V. Easy.
-
The idea
11/19/2016 at 11:36 • 0 commentsYou may remember in the old days, when computers hade RS232 serial ports you could use to make a very cheap pic programmer with just a few resistors and diodes, maybe a capacitor. You could then flash an MCU to make a more usable programmer and the chicken and egg problem was solved.
Nowadays, computers no longer comes with serial ports. Of course you can buy a really cheap usb->serial converter, but they are not really great for bitbanging (because the delay between each usb package is rather long, and for bitbanging you want to send lot and lot of small packet).
I was thinking about the best way to bitbang a protocol without a microcontroler, and start thinking of perforated cards, barcodes... and thought it might be possible to read a protocol printed on paper with phototransistors.
I hade to try.