Giter Site home page Giter Site logo

UART on ATmega8 about modm HOT 4 CLOSED

modm-io avatar modm-io commented on May 9, 2024
UART on ATmega8

from modm.

Comments (4)

salkinium avatar salkinium commented on May 9, 2024
 $ lbuild -r repo.lb -D :target=atmega8 discover -t :platform
Module(modm:platform)   Platform HAL
├── Module(modm:platform:1-wire.bitbang)   Software 1-Wire
├── Module(modm:platform:adc)   Analog-to-Digital Converter (ADC)
├── Module(modm:platform:can.common)   CAN Common
├── Module(modm:platform:clock)   System Clock
│   ╰── NumericOption(f_cpu) = REQUIRED in [1 ... 32000000]   CPU clock frequency
├── Module(modm:platform:core)   AVR Core
│   ├── EnumerationOption(ram_block_length) = 16 in [2, 4, 8, 16, 32, 64]
│   ╰── NumericOption(ram_length) = 1024 in [64 .. 1024 .. 32768]
├── Module(modm:platform:gpio)   General Purpose I/O (GPIO)
├── Module(modm:platform:gpio.common)   GPIO Common
├── Module(modm:platform:i2c)   Inter-Integrated Circuit (I²C)
├── Module(modm:platform:i2c.bitbang)   Software Inter-Integrated Circuit (I²C)
├── Module(modm:platform:spi)   Serial Peripheral Interface (SPI)
│   ╰── BooleanOption(busywait) = False in [True, False]
╰── Module(modm:platform:spi.bitbang)   Software Serial Peripheral Interface (SPI)

Hm… why isn't there a UART module?

from modm.

salkinium avatar salkinium commented on May 9, 2024

There is no "instance" in the driver in modm-devices:

    driver = device.get_driver("usart")
    if "instance" in driver:
        for instance in listify(driver["instance"]):
            module.add_submodule(Instance(int(instance)))
    else:
        return False

=> From here

<driver name="usart" type="avr"/>

=> From here

from modm.

salkinium avatar salkinium commented on May 9, 2024

Looking at the ATmega8 datasheet, modm-devices is correct, the instance is called just USART, not USART0. So the driver needs to be adapted to work with a None or "" (empty string) instance.

from modm.

salkinium avatar salkinium commented on May 9, 2024

The SPI driver does something similar already, by building in modm:platform:spi directly instead of a submodule. I'm not sure why I didn't port this from xpcc the same way: https://github.com/modm-io/modm/blob/develop/src/modm/platform/spi/at90_tiny_mega/module.lb#L79-L92

from modm.

Related Issues (20)

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.