Go Down

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

amkoshesh

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


when i open with atmega328 & atmega168 & atmega88 i dont recieve this error , but for atmega8 i recieve this error. how can i fix it?
p.s: when i use blink app for mega8 , its work properly and wont recieve any error.

please download error.txt file bellow for the following instruction of error and see it. tnx

amkoshesh


hansibull

Quote
when i open with atmega328 & atmega168 & atmega88 i dont recieve this error , but for atmega8 i recieve this error. how can i fix it?
p.s: when i use blink app for mega8 , its work properly and wont recieve any error.

please download error.txt file bellow for the following instruction of error and see it. tnx
You get the error because the ATmega8 doesn't got pin change interrupts (PCINT), which the original SoftwareSerial library requires. However, I've just pushed a commit to MiniCore where I've added a modified version of SoftwareSerial, where you can use the "regular" interrupt pins (INT0 and INT1, Digital pin 2 and 3) for the RX and TX pins. Just do a manual install of the core (remove the old one first), and you're good to go :)
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

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

amkoshesh

You get the error because the ATmega8 doesn't got pin change interrupts (PCINT), which the original SoftwareSerial library requires. However, I've just pushed a commit to MiniCore where I've added a modified version of SoftwareSerial, where you can use the "regular" interrupt pins (INT0 and INT1, Digital pin 2 and 3) for the RX and TX pins. Just do a manual install of the core (remove the old one first), and you're good to go :)
Hi, thanks for the answer. I did not understand what to do. . . Please explain more

hansibull

Quote
Hi, thanks for the answer. I did not understand what to do. . . Please explain more
With the ATmega8 you can only use digital pin2 and 3 for the software serial library

Code: [Select]
SoftwareSerial mySerial(2, 3); // RX, TX
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

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

amkoshesh

With the ATmega8 you can only use digital pin2 and 3 for the software serial library

Code: [Select]
SoftwareSerial mySerial(2, 3); // RX, TX
Well, I did exactly the same thing. . Please see the code I sent

hansibull

That means that you're still using the SoftwareSerial library that comes with the IDE. Remember, you want to use the custom one.

BTW you should post the new error too. It's important because you need to know which directory the IDE is getting the library from
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

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

amkoshesh

That means that you're still using the SoftwareSerial library that comes with the IDE. Remember, you want to use the custom one.

BTW you should post the new error too. It's important because you need to know which directory the IDE is getting the library from
hey bro i know about this problem! i want a solution to solve it! but i dont know how to use custom one code. if you may please guide me step by step to type the correct code and use costum IDE ill be glad so much. i get an error every time

hansibull

Try an example. Select ATmega8 in the boards menu, and choose SoftwareSerial (MiniCore) under the examples menu. I get no errors when compiling SoftwareSerialExample.

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

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

amkoshesh

Try an example. Select ATmega8 in the boards menu, and choose SoftwareSerial (MiniCore) under the examples menu. I get no errors when compiling SoftwareSerialExample.


Hi, I got an error again! Is it possible to log into my computer via TeamViewer software and solve my problem?

pert

Do this:
  • Delete E:\app\barnameh\ARDUINO\arduino-1.8.1-windows\arduino-1.8.1\hardware\MiniCore-master. Please be very careful when deleting things on your computer. When in doubt back up!
  • Download https://github.com/MCUdude/MiniCore/archive/master.zip
  • Unzip the downloaded file
  • Move the extracted folder to C:\Users\abbas\Documents\Arduino\hardware. If the hardware folder doesn't already exist then create it.
  • Restart the Arduino IDE if it's running.


Note that you should never install anything to the Arduino IDE installation folder because anything you put there will be lost when you update to a new version of the Arduino IDE. Instead, always do manual installation of hardware packages and libraries to the sketchbook folder, as was intended.

amkoshesh

Do this:
  • Delete E:\app\barnameh\ARDUINO\arduino-1.8.1-windows\arduino-1.8.1\hardware\MiniCore-master. Please be very careful when deleting things on your computer. When in doubt back up!
  • Download https://github.com/MCUdude/MiniCore/archive/master.zip
  • Unzip the downloaded file
  • Move the extracted folder to C:\Users\abbas\Documents\Arduino\hardware. If the hardware folder doesn't already exist then create it.
  • Restart the Arduino IDE if it's running.


Note that you should never install anything to the Arduino IDE installation folder because anything you put there will be lost when you update to a new version of the Arduino IDE. Instead, always do manual installation of hardware packages and libraries to the sketchbook folder, as was intended.
that was perfect
Very good
Thank you
Thank you
Error erased
I must go now
Replace atmega8 hardware with atmega328
You worked hard for me
Thank you

jpresto

Hi, may be obvious question is it possible to support the m168pb by just changing the signature in the avrdude.conf file or is there a reason I wouldn't want to do this? thanks in advance-

Jiggy-Ninja

I think the m168pb is not just a clone of the m168p, it has some different registers and stuff.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

sbintoro

Hello,
I've downloaded minicore, and tested it using blink for quick timing check (atmega8, 8 mhz external clock) and it looks OK, soon i tried to upload my sketch, it has I2C LCD display (F.Malpartida) function, and it didn't work, lcd just showed blank. My display sketch works very well on atmega328 with the same hardware setup (same lcd, same connection). What to be check ?

regards

Go Up