Code Monkey home page Code Monkey logo

atmega-demo's People

Contributors

timdrysdale avatar

Watchers

 avatar  avatar

atmega-demo's Issues

12MHz bootloader

Saving an extended component fee by selecting 12MHz crystal has complicated setting up a bootloader.

This is not quite resolved yet.

Recompiling the bootloader causes this issue
https://forum.arduino.cc/t/optiboot-issue-avrdude-error-address-0x8010-out-of-range/863387

atmega328_12: TARGET = atmega328_12
atmega328_12: MCU_TARGET = atmega328p
atmega328_12: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
atmega328_12: AVR_FREQ = 12000000L
atmega328_12: LDSECTIONS  = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega328_12: $(PROGRAM)_atmega328_12.hex
atmega328_12: $(PROGRAM)_atmega328_12.lst

atmega328_isp_12: atmega328
atmega328_isp_12: TARGET = atmega328_12
atmega328_isp_12: MCU_TARGET = atmega328p
# 512 byte boot, SPIEN
atmega328_isp_12: HFUSE = DE
# Low power xtal (12MHz) 12KCK/14CK+65ms
atmega328_isp_12: LFUSE = FF
# 2.7V brownout
atmega328_isp_12: EFUSE = 05
atmega328_isp_12: isp

boards.txt

tim.name=Tim

tim.upload.tool=avrdude
tim.upload.protocol=arduino

tim.bootloader.tool=avrdude
tim.bootloader.unlock_bits=0x3F
tim.bootloader.lock_bits=0x0F

tim.build.f_cpu=12000000L
tim.build.board=AVR_NANO
tim.build.core=arduino
tim.build.variant=eightanaloginputs

## Arduino Tim w/ ATmega328P
## --------------------------
tim.menu.cpu.atmega328=ATmega328P

tim.menu.cpu.atmega328.upload.maximum_size=30720
tim.menu.cpu.atmega328.upload.maximum_data_size=2048
tim.menu.cpu.atmega328.upload.speed=115200

tim.menu.cpu.atmega328.bootloader.low_fuses=0xFF
tim.menu.cpu.atmega328.bootloader.high_fuses=0xDA
tim.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
tim.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328_12.hex

tim.menu.cpu.atmega328.build.mcu=atmega328p

swap TXD,RXD pins on CH340

The CH340 works with the pins the other way round to what you might think .... RXD goes to TX and vice versa. See here. This has been verified with a board hack to cut the lines to vias from TP4, TP5 and connect TP4 to the via that used to be connected to TP5, and vice versa. Then USB serial transmission works in both directions, as evidenced by an echo program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.