-
Another Atmega328PB Board - The Superstick
12/20/2016 at 14:01 • 3 comments -
Worlds first Atmega328PB Package for Arduino
12/15/2016 at 13:50 • 0 commentsSorry for the long time that i didn't write something here.
What's new?
Since a while, Arduino changed the AVR compiler to 4.9.2. With this version it is possible to compile now for the new chip without patching it. I wrote now a package which do exactly this.
This package contains also the specific Atmel files for this MCU. Because the header file io.h doesn't know about this chip, I used a small hook to get it known. Another hook is to let the linker know about this chip. You can find this in the platform.txt.
You can install the package just copy this URL into your Arduino IDE:
https://raw.githubusercontent.com/amoehl/uino-atmega328pb/master/package_atmega328pb_index.json
Check out my repository:
-
Bugs
03/23/2016 at 22:03 • 0 commentsFound a BUG in my SPI Lib. So please don't use. I will upload a new one later. I work currently with this chip at work. I develop a Test- and Programming Station.
The boards with the 328PB act as slave controller which test and programs the target boards. So they need to talk to a Master and to the Target. Therefore I need two hardware UART. Software Uart is to slow.
In one test, the target (has a Atmega328P, running at 16 MHz) sends data with 115200 Baud. The function uses Arduino-like Serial.write(...). Weird is, that the 328PB seems to have a problem to receive at full speed. If I slow down by 400us between each write, it's working.The Slavecontroller receives at Uart1, which is combined with MISO0 and MOSI0.
I will see more tomorrow.
Good Night.
-
*uino Prototypes
02/28/2016 at 17:11 • 0 commentsI've got some prototypes from a German company: Watterott
They will be available soon. These boards have the same Pinout like the Arduino.
-
USB Host with Atmega328PB and MAX3421
02/28/2016 at 17:05 • 0 commentsProject Update:
I patched the USB Library for the MAX3421E USB Host chip to use SPI1 of the Atmega328pb.
Yes, it is working now too. Problem is that is now hardcoded. In the Host Library you cannot choose the SPI Port.
-
Easy Way to a Toolchain for the Atmega328PB
01/29/2016 at 16:29 • 0 commentsAfter compiling a lot time the avr toolchain by myself, I found an easier solution.
I tried the gcc version 6.0.0, 4.8.9 and 4.9.2. There is are some problems with the gcc. every time i patched the new device, the gcc doesn't know about the Atmega328pb. It means, the device is never shown in the call:
$ avr-gcc --target-help
but I always could compile the for this device, so the gcc itself knew about. I used the information from the Patch, which someone from Atmel send to the gcc-developer. As someone want to know about all the patches, I did, I wrote all down. But just now, I want to describe the easy way.
Thanks to Atmel, they provide a toolchain for Windows and Linux. Because I am working with Linux, I downloaded the toolchain there:
http://www.atmel.com/tools/atmelavrtoolchainforlinux.aspx
This toolchain contains the gcc 4.9.2 with a few patches from the 6.0.0 version. I don't know exactly, which patches, but I analysed their compiling script (http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/3.5.0/build-avr8-gnu-toolchain-git.sh).
But luckily, they have a finished toolchain. But now we need to add the device. These informations are int the AVR device pack: http://www.atmel.com/images/partpack_ATmega328PB-trunk-6.2.9.zip
But aware, these files are outdated already, there Atmel Studio has newer one.
In the end, I found 3 different header files. In one file, there were some Register missing.
Here is the another Pack Link, which is newer:
http://packs.download.atmel.com/ - Atmel ATmega Series Device Support (1.0.91)
We need the following files:
- libatmega328pb.a
- iom328pb.h
- crtatmega328pb.o
Put the lib and the crtatmega328pb.o into "/avr/lib".
Put the io*.h into "avr/include/avr"Done !
I also patched the "io.h", but this seems not necessary since the header file can build the filename by itself, when it is not found.
I put everything into Arduino, so I could easy see, if it's working. Because i made my own PCB, I made my own board.txt.
super.name=Super Mini super.upload.tool=avrdude super.upload.protocol=arduino super.bootloader.tool=avrdude super.bootloader.low_fuses=0xff super.bootloader.unlock_bits=0x3F super.bootloader.lock_bits=0x0F super.build.f_cpu=20000000L super.build.board=AVR_MINI super.build.core=arduino:arduino super.build.variant=super ## Super Mini w/ ATmega328PB ## ------------------------- super.menu.cpu.atmega328=ATmega328pb super.menu.cpu.atmega328.upload.maximum_size=28672 super.menu.cpu.atmega328.upload.maximum_data_size=2048 super.menu.cpu.atmega328.upload.speed=115200 super.menu.cpu.atmega328.bootloader.high_fuses=0xd8 super.menu.cpu.atmega328.bootloader.extended_fuses=0x05 super.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328pb.hex super.menu.cpu.atmega328.build.mcu=atmega328pb super.build.extra_flags=
and my own variant "pins_arduino.h". About that, later.Finally I need to patch the avrdude.conf:
Simply add below the Atmega328 Part:
part parent "m328" id = "m328pb"; desc = "ATmega328PB"; signature = 0x1e 0x95 0x16; ocdrev = 1; ;
Later I explain about the bootloader...
-
Testing the PWM
01/27/2016 at 08:59 • 0 commentsI forgot to set to DC...
-
For the Gallery
01/27/2016 at 08:46 • 1 comment -
Firmware runs with 20 MHz
01/27/2016 at 08:42 • 0 commentsI worked a while on the code. This is the result now:
A short update:
- Bootloader - OK
- Every IO Pin - OK
- Both Serial - OK
- 9* PWM - OK
- SPI - SPI0 works, SPI1 TODO
- I²C/TWI - TWI2 works, TWI0 TODO
Usable with Arduino 1.6.5 IDE