12/20/2016 at 14:01 •
12/15/2016 at 13:50 •
Sorry for the long time that i didn't write something here.
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:
Check out my repository:
03/23/2016 at 22:03 •
Found 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.
02/28/2016 at 17:11 •
I've got some prototypes from a German company: Watterott
They will be available soon. These boards have the same Pinout like the Arduino.
02/28/2016 at 17:05 •
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.
01/29/2016 at 16:29 •
After 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:
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:
Put the lib and the crtatmega328pb.o into "/avr/lib".
Put the io*.h into "avr/include/avr"
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...
01/27/2016 at 08:59 •
I forgot to set to DC...
01/27/2016 at 08:46 •
01/27/2016 at 08:42 •
I 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