Go Down

Topic: MiniCore - An Arduino core for the ATmega8/ 48/ 88/ 168/ 328 (Read 4324 times) previous topic - next topic

hansibull

Hi!
Last year I accidentally ordered an ATmega328 instead of an ATmega328p. I thought there wouldn't be a problem using the ATmega328 in Arduino IDE, but I was completely wrong. All Atmel microcontrollers have a device signature, and in this case ATmega328 and ATmega328p doesn't share the same signature. This means that the ATmega328 isn't officially supported (the same goes for the ATmega168).
I started searching for 3rd party cores that would add support for this, but I couldn't find any. That's why I decided to create one myself!  :)

This core is supposed to be working perfectly, but lets be honest; that ain't gonna happened right after the release. I'm able to squash a few bugs here and there, but I sure need your help in order to make this a bug free core.


Why use other chips that the ATmega328P?
- You might not need 32kB flash and 2kB ram for your project
- Some chips are dirt cheap and can be bought for under a dollar at Ebay or AliExpress
- Less is more  :)


Core features:
- All microcontrollers (Except the ATmega48 which doesn't have a bootloader) are running Majek's famous Optiboot port which lets you write to the flash memory while the application is running.
- Extra keywords highlighting (Like DDRA, PORTB, PINC and so on)
- Selectable clock frequency, microcontroller variant and brown out option in the Tools menu
- Possible to use the XTAL pins as digital IO pins if the internal oscillator is enabled
- Boards manager URL (HUGE thanks to Pert)!
- Eclipse support!


Supported clock frequencies:
- 16 MHz external oscillator
- 20 MHz external oscillator
- 12 MHz external oscillator
- 8 MHz external oscillator
- 8 MHz internal oscillator
- 1 MHz internal oscillator


What the core doesn't have:
- Support for the older Arduino 1.5.x and 1.0.x versions (Arduino IDE 1.6.x required)
- Support for the ATmega88/168/328PB


The core and more information is available at my Github repository:
https://github.com/MCUdude/MiniCore


Please let me know if you have any feedback! :D

MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

hansibull

MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

swe-dude

Hello i just tried to give your core a test spin on a old atmega8 i had lying around but when i try to burn the boothloader i get this ""efuse" memory type not defined for part "ATmega8"
Fel vid bränning av bootloader." i have tried on 1.6.8 and 1.6.5, (core installed with the boards manager link)


I tried usbasp and stk500 board same message sorry.

hansibull

I totally forgot to make a specific rule for the ATmega8, which doesn't have an extended fuse. I just tested it and  pushed a fix. Try download the latest zip :)
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

DrAzzy

Oh awesome - I'd somehow never realized that you could deal with the efuse problem like that, nice! I know a lot of people have been running into that issue, particularly users in deprived foreign lands where the atmega8 is the best micro they can scare up.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

hansibull

I've had a look over at the Arduino Github repo to see how they deal with this on the Arduino NG. It doesn't seems like they are doing anything at all! Are some people having efuse issues with the NG option selected with the atmega8?

I've used this platform.txt modification on the Atmega 16, 32, and 8535 as well! Quick and dirty  :D
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

DrAzzy

Yes, they have problems quite often. Just this week I told someone to manually do it with avrdude...
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

swe-dude

Just tested it again and its working perfect no more e-fuse problem, now i can finally get rid of all those messy single cores. Thank you!!!

Another thing do you have any idea how to make the boothloader work at 3.3v with internal 8 or 1 MHz?, that might be usefull from time to time , i know i have been looking for one other times with no luck.
Or that problem might be with the atmega8 and not the boothloader?

hansibull

The 8 MHz and 1 MHz option should work just fine on 3.3v, at least with the ATmega8L. I haven't tried running my ATmega8 on 3.3v, but I guess it's possible. Don't the ATmega8 boot at 3.3v, or is it just unstable?
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

swe-dude

If i load it at 5v it runs OK 3.3v, the problem is that i cant upload at 3.3v i have tried FT232RL,CP2102 and  CH340G. a bit annoying if i have to remove the nrf24l01 or similar every time i upload something.

If you have the time try uploading at 3.3v so i know if its just some local problem with my setup.

Any way nice work with the core i will give the 12mhz external a try on a usbasp later on.

hansibull

Quote
If i load it at 5v it runs OK 3.3v, the problem is that i cant upload at 3.3v i have tried FT232RL,CP2102 and  CH340G. a bit annoying if i have to remove the nrf24l01 or similar every time i upload something.
You can still have 5v Rx and Tx line even though the microcontroller is running at 3.3v. The FTDI/CP2102/CH304G will handle this fine. I'm actually doing this on the DIP-40 AVR/Arduino board I've designed. I have a 3.3v/5v jumper to select the microcontroller voltage. The CH340G are always running at 5v, but doesn't seem to care about the 3.3v line. Your nRF24L01 will still get its 3.3v :)

Quote
Yes, they have problems quite often. Just this week I told someone to manually do it with avrdude...
I just tested this, and there is indeed an efuse error. According to other users it hasn't been working since 1.6.0. Why haven't anyone created a pull request to fix this? Can't be THAT hard :P
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

hansibull

A new release of the core is now available!

Changelog:
  • Efuse error on the ATmega8 resolved
  • Lock bit error on the ATmega48 resolved
  • Support for Arduino Eclipse IDE added!

If you're using the boards manager URL you can just upgrade in the IDE directly :)

I'm really excited about the Arduino Eclipse support. The latest nighty builds lets you change the clock frequency and Brown out fuse bits; just like in Arduino IDE.
Download the Arduino Eclipse plugin (or complete IDE, your choice) here: http://eclipse.baeyens.it. Instructions on how to install MiniCore (or any other particular core with a boards manager URL) can be found HERE: MiniCore - Eclipse

Please let me know if you have any questions or belive you've found a bug  :D
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

DrAzzy

What has to be done to support the Eclipse IDE in a third party board package?
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

hansibull

Not really. First this is to get yourself a boards manager URL, which you have ;) then you need to add the file externalprogrammers.txt to your avr folder. The reason why it doesn't accept programmers.txt is that it would require all 3rd party cores to have their own set of programmers. If not there wouldn't be possible to use them in Eclipse. In other words, Eclipse can't use programmers from other cores.

Still, if I added a full set of programmers to this core, it would mess up Arduino IDE completely with duplicated programmers everywhere! I had a discussion with the author of this plugin, and decided to call the file externalprogrammers.txt, to prevent interfering with Arduino IDE.
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

mrburnette

No interest? I am surprised  :(
Well, I have not forgotten putting that "P suffix" into my Mouser orders!  Had I, I'd be jumping for joy over your core effort  :)

But, I took some time with my coffee this morning and looked over your effort - excellent.
Any reason you decided to not include the 85P?

Ray

Go Up