IR bed level

The easyEDA fils have been updated to 0.2, and the revision sent to fab with EasyEDA
ETA 1-2 weeks

1 Like

The boards arrived on friday and I had a chance to frypan-reflow four of them last night.

Unfortunately the SOIC8 lands are slightly off (Or the chips are-either way) so they need a little bit of rework and the through-hole stuff mounted tonight.

Anyone able to help with firmware, that would be great - I’ve dragged out my old Win7 laptop (sans screen) to install Atmel studio on, but if someone could compile the source code for me that would be great.
I suspect that despite being open source it’s closed dependencies (something called ECV)

Source is here https://github.com/dc42/OrmerodSensorBoard/tree/master/Firmware/Mini-differential-IR

I would also be happy at rolling my own code but would need some help - my C-fu is stuck at Arduino level, and although I understand the principles of running on ADC interrupts I lack any experience.

I would roll it as a state machine;
State 0: Update endstop signal (Normally low, high triggered). Accumulate three ADC readings with both IR off
State 1: Near LED on, Accumulate three ADC readings with near IR on
State 2: both LEDs off, Discard three ADC readings
State 3: Far LED on, Accumulate four ADC readings with far LED on

cycling through the four states, and updating the endstop output after ech cycle
Ideally I’d use the ADC interrupt to catch each one asap, and ensure a full capture between each read

1 Like

Looks like it can be compiled with vanilla avrgcc no problem. The ecv stuff is for a formal verification tool, but all that is automatically disabled by ecv.h when compiling with a regular toolchain (lucky me the avrgcc in the current Arduino release is borked, had to install a fresh one…)