Giter VIP home page Giter VIP logo

atmega324pb-bus-ninja's Introduction

ATmega324PB-Bus-Ninja

Port the tobyjaffey's bus-ninja to ATmega324PB Xplained Pro board.

Features

  • Hardware I2C (default 100kHz, up to 400kHz)
  • I2C address scanner ('s' command from i2c mode)
  • SPI (default 500kHz, up to [email protected], 8MHz@5V)
  • PWM
  • GPIO
  • ADC

Usage

UART Setting

Default baud rate: 1Mbps@8Mhz SYS_CLK

SPI

Connection

FunctionATmega324PB Pin
SPI CLKPORTB7
SPI MISOPORTB6
SPI MOSIPORTB5
SPI CSPORTB
LEDPORTC7

Syntax

[	Chip select (CS) active (low).
{	CS active (low), show the SPI read byte after every write.
] or }	CS disable (high).
r	Read one byte by sending dummy byte (0xff). (r:1…255 for bulk reads)
0b	Write this binary value. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.
0x	Write this HEX value. Format is 0×01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.
0-255	Write this decimal value. Any number not preceded by 0x or 0b is interpreted as a decimal value.

Example

> spi
> [0x40 0x0A 0x28]
CS ENABLED
WRITE: 0x40
WRITE: 0x0A
WRITE: 0x28
CS DISABLED
> [0x40 r]
CS ENABLED
WRITE: 0x40
READ: 0x00
CS DISABLED  
> {0x40 r:2}
CS ENABLED
WRITE: 0x40
READ: 0x00
READ: 0x01
READ: 0x02
CS DISABLED

I2C

Connection

FunctionATmega324PB Pin
I2C SDAPORTE5
I2C SCLPORTE6

Syntax

{ or [	Issue I2C start condition.
] or }	Issue I2C stop condition.
r	Read one byte, send ACK. (r:1…255 for bulk reads)
s   I2C address scanner
0b	Write this binary value, check ACK. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.
0x	Write this HEX value, check ACK. Format is 0×01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.
0-255	Write this decimal value, check ACK. Any number not preceded by 0x or 0b is interpreted as a decimal value.

Example

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.