Model Railroad Control Panel Interface avr-ErbertInterface
Arduino based interface to connect a control panel to the PC
Brought to you by:
andre_schenk
Increase 32 bytes limit in Wire library ======================================= #define BUFFER_LENGTH 0x85 Arduino Due ----------- vi ~/.arduino15/packages/arduino/hardware/sam/1.6.12/libraries/Wire/src/Wire.h Arduino Zero ------------ vi ~/.arduino15/packages/arduino/hardware/samd/1.6.20/cores/arduino/RingBuffer.h (SERIAL_BUFFER_SIZE) Arduino Mega, Uno ----------------- http://forum.arduino.cc/index.php?topic=54439.0 ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/large_i2c_buffer/arduino/Wire.h.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/large_i2c_buffer/arduino/twi.h.patch for IDE: -------- ( cd / && patch --forward --reject-file=- --strip=0 ) < patches/large_i2c_buffer/packages/Wire.h.patch ( cd / && patch --forward --reject-file=- --strip=0 ) < patches/large_i2c_buffer/packages/twi.h.patch Teensy ------ sudo vi /opt/arduino/hardware/teensy/avr/libraries/Wire/Wire.h sudo vi /opt/arduino/hardware/teensy/avr/libraries/Wire/WireKinetis.h sudo vi /opt/arduino/hardware/teensy/avr/libraries/Wire/utility/twi.h Reduce size of Ethernet library =============================== http://michaelnoland.com/reducing-code-size-on-arduino-ethernet-boards/ ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/Dns.h.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/Dns.cpp.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/EthernetClient.h.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/EthernetClient.cpp.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/EthernetUdp.h.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/EthernetUdp.cpp.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/Client.h.patch ( cd / && sudo patch --forward --reject-file=- --strip=0 ) < patches/small_ethernet_lib/arduino/Udp.h.patch for IDE: -------- vi ~/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino/Udp.h vi ~/.arduino15/packages/arduino/hardware/avr/1.6.21/cores/arduino/Client.h Interface 1051200 ================= Write firmware to ATmega16U2 ---------------------------- avrdude -v -P usb -c avrisp2 -p atmega16u2 -e -U flash:w:firmwares/m16u2.flash.hex -U lfuse:w:0xef:m -U hfuse:w:0xd9:m -U efuse:w:0xf4:m -U lock:w:0xff:m Write bootloader, firmware to ATmega2560 ---------------------------------------- avrdude -v -P usb -c avrisp2 -p atmega2560 -e -U flash:w:/opt/arduino/hardware/arduino/avr/bootloaders/stk500v2/stk500boot_v2_mega2560.hex:i -U lock:w:0xff:m avrdude -v -P usb -c avrisp2 -p atmega2560 -D -U flash:w:build-mega-atmega2560/ErbertInterface_.hex -U lfuse:w:0xff:m -U hfuse:w:0xd8:m -U efuse:w:0xfd:m Programmer 1051210 ================== Write bootloader to ATmega32U4 ------------------------------ avrdude -v -P usb -p atmega32u4 -c stk500v2 -e -U lock:w:0xFF:m -U efuse:w:0xcb:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m avrdude -v -P usb -p atmega32u4 -c stk500v2 -U flash:w:/opt/arduino/hardware/arduino/avr/bootloaders/caterina/Caterina-Leonardo.hex:i Write firmware to ATmega32U4 ---------------------------- avrdude -v -P usb -p atmega32u4 -c stk500v2 -U flash:w:build-leonardo/ErbertInterface.hex