I get a warning for the efuse F5 != FD when i burn bootloader, but sketches seem to load correctly. I use both Usbasp and Arduino as Isp with no problems.
Nano 's with atmega328PB.
Arduino IDE 1.8.8
MiniCore 2.0.1
Linux Mint 18.3
I believe there's a bug in the avrdude.conf file in the v2.0.1. Can you try removing your boards manager install and do a manual install instead? This will fetch the latest commits. I should probably issue a new release soon if this get rid of the error you're seeing.
I've tried your core on multiple computers (Mac and PC) and with multiple versions of the Arduino IDE with no success. I'm not able to burn the bootloader or upload any code. The process always fails after writing, when reading back/verifying. It fails on the first byte. There is always some error message like "00 != 01" or some such, making it a mismatch and halting the process. I'm using "Arduino as ISP" for the upload method.
I definitely recommend getting a dedicated programmer such as the USBasp or USBtinyISP. There seems to me much less trouble with these. Can you turn on verbose upload in the IDE settings and post the entire avrdude output?
I believe there's a bug in the avrdude.conf file in the v2.0.1. Can you try removing your boards manager install and do a manual install instead? This will fetch the latest commits. I should probably issue a new release soon if this get rid of the error you're seeing.
It works.
Using Port : usb
Using Programmer : usbasp
AVR Part : ATmega328PB
avrdude: 1 bytes of lock verified
avrdude: reading input file "0b11110101"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0b11110101:
avrdude: load data efuse data from input file 0b11110101:
avrdude: input file 0b11110101 contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
I've burned an atmega8 and now it is blinking as expected. I've tied pin 2 and 3 to the usb-serial to upload a program but no luck even changing baudrate. "not in synch". Is there any that I can check? Should I change some setup in the IDE (1.8.3)? is the "programmer" option of any use to upload code?
aldolo:
I've burned an atmega8 and now it is blinking as expected. I've tied pin 2 and 3 to the usb-serial to upload a program but no luck even changing baudrate. "not in synch". Is there any that I can check? Should I change some setup in the IDE (1.8.3)? is the "programmer" option of any use to upload code?
What are your exact connections between the USB-serial and the ATmega8?
I am designing a decoder to drive a number of servos. I was planning on using the ATtiny84 but am having some funny problems - I am sure I am running out of SRAM. I am using the IDE with Dr Azzy's excellent ATtiny core - thanks for that one. Worked great on my previous ATtiny85 project.
I replaced the ATtiny with a ATmega328P and all is fine. While looking for a suitable chip I found that the ATmega328PB is only slightly more expensive than the ATtiny84 (both in a QFN package), so decided to try and use that.
Information programming it using the IDE seems to be rather lacking. I was wondering why we do not have an ATmega option like we have for the ATtinys, you can only select some commercial board. Then I came across hansibull's MiniCore and there it was. Thanks for all the work making that available to us. Also thanks for all the people contributing to it's success.
Now for a question.
I have read that some people are having problems with the crystal clock's stability due to the dropping of the full-swing option. There were suggestions to use an oscillator instead. Seeing that I need to design and make a PC board I would like to use the most stable option. Will a 16MHz crystal or resonator do the job, or do I go for an external oscillator - price is not that much more.
If I go with an oscillator, how do I burn the correct fuses. All the clock options for the ATmeag328s seems to be for an external crystal/resonator. Can I add an option setting the low-fuse to 0xE0 (I think that is what the documentation says) with the correct baudrate and frequency (16MHz)? Once soldered to a SMD board one cannot afford to brick the MCU.
I have decided that proper bypassing outranks crystal placement, but the crystal is next most important (that discussion was when I flipped my thinking).
I have read that some people are having problems with the crystal clock's stability due to the dropping of the full-swing option. There were suggestions to use an oscillator instead. Seeing that I need to design and make a PC board I would like to use the most stable option. Will a 16MHz crystal or resonator do the job, or do I go for an external oscillator - price is not that much more.
I believe you can choose an "off the shelf" crystal oscillator, and it will work with the ATmega328PB. However since there's no full swing option anymore you should place it as close to the pins as possible. The board ron_sutherland posted a picture of does work, but preferably the crystal should have been placed closer to the XTAL pins. I designed a similar looking board for use with 44-pin AVRs, specifically the new ATmega324PB.
This chip is very similar to the 328PB, and I'm pretty sure they were designed by the same dev team since they share the same silicon bugs as well.
On the 324PB board the external oscillator were placed even futher away and didn't work at all. I swapped the 324PB out with a 1284P with full swing enabled, and the external oscillator now worked as expected.
If I go with an oscillator, how do I burn the correct fuses. All the clock options for the ATmeag328s seems to be for an external crystal/resonator. Can I add an option setting the low-fuse to 0xE0 (I think that is what the documentation says) with the correct baudrate and frequency (16MHz)? Once soldered to a SMD board one cannot afford to brick the MCU.
It doesn't really matter if you use an external crystal/resonator (that needs to be driven) or an external oscillator with one clock output signal. You can use the same fuse settings as you'd do with an "ordinary" crystal.
@ron_sutherland.
Thanks for the link. I read it all. I normally do decouple all power supply lines. While looking at your schematics I noticed that you decoupled the Aref line as well. That prompted me to have a carefull look at the data sheets and found they actually tell you to. I used to leave it floating but now that I understand how that part works, it makes a lot of sense. Always learning something new.
@hansibull.
Thanks for explaining your experience with crystals. Also for the information as to the fuse settings. Looking at it like that, I can see why using the same settings are good.
After reading the above, and again looking at my supply for oscillators, I decide to stick with a crystal for the time being. The only 5V oscillator listed in small quantities costs more than the processor. So, unless I am prepared to buy 1000 units - not going to happen, it will be a crystal.
Thanks again. I will post my experience when it is all built and tested - it may take a while.
Hello,
I'm unable to compile code for an Atmega328PB using the IridiumSBD library with the MiniCore. Error shows up when it tries to link the files:
IridiumSBD.cpp.o:(.rodata+0x0): undefined reference to `IridiumSBD::internalBegin()::__c'
Confirmed that it is linking the library in, and the 'internalBegin' function is defined within. Has anyone else tried to use this library with the MiniCore?
Thank you
I have tried minicore with 328PB (cheap now) with arduino 1.8.8 and another board - UNO as programmer.
Everything works, but not at right frequency. I am using a 20MHz resonator setting but board obviously uses internal 1MHz (1000 ms blink example takes around 20 sec) /I can change to internal 8MHz and it is 8* faster - so some settings work as should/
I have checked with oscilloscope but no activity - if the resonator was correctly set and was not compatible (I doubt this), it wont just do anything.
I wonder whether it is just problem with lacking support of the programmer (UNO) used...
Actually, after trying with a 328P (same result with delay depending on crystal selection) I have found out that you actually HAVE to burn the bootloader first - I wonder why the same program does not work without the bootloader - maybe fuse bits not set correctly?
Actually, after trying with a 328P (same result with delay depending on crystal selection) I have found out that you actually HAVE to burn the bootloader first - I wonder why the same program does not work without the bootloader - maybe fuse bits not set correctly?
You have to burn the bootloader in order to set the correct fuse bits. However I wouldn't be too optimistic about the 20 MHz resonator. The 328PB lacks a full swing oscillator drive option (328P has it). This means it's not able to drive external crystals/resonators "as hard" as the 328P can. What's probably happened for you is that the 328PB have detected a faulty clock signal and switched over to an internal "recovery clock". You can read more about "clock failure detection" in the 328PB datasheet.
You may try to move the resonator as close the the XTAL1 and XTAL2 pins as possible. If it still doesn't work you'd probably have to make an external oscillator driver circuit to feed the 328PB with a stable 20MHz signal on the XTAL1 input.
Datasheet indicates that maximum supported speed with oscillator or resonator is 16MHz, as far as I can tell, per the Low Power Crystal Oscillator section.
To get the full 20MHz you need external clock source by my reading of Clock Sources section of datasheet.
It's a shame they removed the full swing option from the 328pb.
Hi, I'm using MiniCore with atmega328P @ 8MHz INTERNAL and it was great !
It solved my problem concerning the use of WatchDog with minimal configuration.
Unfortunately MiniCore introduces another problem that was the uploading at 3.3V.
I tried all baudrate speeds but the problem still happens.
I changed USB converter and I applied a big capacitor close to the board: no success.
It is enough increasing the power supply (Desk Power Supply) over 3.8V and the problem is solved.
Maintaining the same hardware (board, usb converter, power supply) , I flash an old boot loader (from breadboard.zip) and the upload work at 3.3V without problem.
In my plan I want to try to insert a level shifter.
[SOLVED] - Upload Sketch @ 1Mhz Internal, 3.3V via optiboot.
The problem is that @ 1Mhz Internal and 3.3V, the clock is not 1Mhz but considerably lower.
In my case it was about 970Khz.
Solution:
Measuring of the real clock: I did it modifyng the fuse for clock output and connecting Arduino to a Frequency counter.
Modify board.txt in order to set baudrate to a not standard value : 9600*97/100=9312.
Arduino IDE will warn that baudrate is not a standard value, but it will upload the sketc.
Now, if you want, you can set OSCCAL value at the beging of your sketch, in order to adjust the clock.
This modification doesn't involve bootloader.