# MiniCore
An Arduino core for the ATmega8, ATmega48, ATmega88, ATmega168 and ATmega328, all running a [modified version of Optiboot](#write-to-own-flash). This core requires at least Arduino IDE v1.6.2, where v1.6.5+ is recommended. <br/>
<b>This core gives you two extra IO pins if you're using the internal oscillator!</b> PB6 and PB7 is mapped to [Arduino pin 20 and 21](#pinout).<br/>
If you're into "pure" AVR programming, I'm happy to tell you that all relevant keywords are being highlighted by the IDE through a separate keywords file. Make sure to test the [example files](https://github.com/MCUdude/MiniCore/tree/master/avr/libraries/AVR_examples/examples) (File > Examples > AVR C code examples). Try writing a register name, <i>DDRB</i> for instance, and see for yourself!
# Table of contents
* [Supported microcontrollers](#supported-microcontrollers)
* [Supported clock frequencies](#supported-clock-frequencies)
* [BOD option](#bod-option)
* [Link time optimization / LTO](#link-time-optimization--lto)
* [Programmers](#programmers)
* [Why add Arduino support for these microcontrollers?](#why-add-arduino-support-for-these-microcontrollers)
* [Write to own flash](#write-to-own-flash)
* **[How to install](#how-to-install)**
- [Boards Manager Installation](#boards-manager-installation)
- [Manual Installation](#manual-installation)
* **[Getting started with MiniCore](#getting-started-with-minicore)**
* **[Pinout](#pinout)**
* **[Minimal setup](#minimal-setup)**
## Supported microcontrollers:
* ATmega8<b>*</b>
* ATmega48<b>*</b>
* ATmega88<b>*</b>
* ATmega168<b>*</b>
* ATmega328<b>*</b>
<b>*</b> All variants (A, P, PA) except PB
Can't decide what microcontroller to choose? Have a look at the specification table below:
| | ATmega328 | ATmega168 | ATmega88 | ATmega48 | ATmega8 |
|--------------|-----------|-----------|----------|----------|---------|
| **Flash** | 32kB | 16kB | 8kB | 4kB | 8kB |
| **RAM** | 2kB | 1kB | 1kB | 512B | 1kB |
| **EEPROM** | 1kB | 512B | 512B | 256B | 512B |
| **PWM pins** | 6 | 6 | 6 | 6 | 3 |
## Why add Arduino support for these microcontrollers?
* They are all Arduino UNO compatible (drop-in replacement)
* They're extremely popular and used in almost every Arduino project out there
* They're cheap (some can be bought for less than a dollar at AliExpress and Ebay)
* They come in both DIP and TQFP packages
* You can now choose the suited microcontroller for your project. No need to go for overkill!
## Supported clock frequencies
* 16 MHz external oscillator (default)
* 20 MHz external oscillator
* 18.432 Mhz external oscillator <b>*</b>
* 12 MHz external oscillator
* 8 MHz external oscillator
* 8 MHz internal oscillator <b>**</b>
* 1 MHz internal oscillator
Select your microcontroller in the boards menu, then select the clock frequency. You'll have to hit "Burn bootloader" in order to set the correct fuses and upload the correct bootloader. <br/>
Make sure you connect an ISP programmer, and select the correct one in the "Programmers" menu. For time critical operations an external oscillator is recommended.
</br></br>
<b>*</b> When using the 18.432 MHz option (or any frequency by which 64 cannot be divided evenly), micros() is 4-5 times slower (~110 clocks). It reports the time at the point when it was called, not the end.
This clock frequency is not recommended if your application relies on accurate timing, but is [superb for UART communication](http://wormfood.net/avrbaudcalc.php?bitrate=300%2C600%2C1200%2C2400%2C4800%2C9600%2C14.4k%2C19.2k%2C28.8k%2C38.4k%2C57.6k%2C76.8k%2C115.2k%2C230.4k%2C250k%2C.5m%2C1m&clock=18.432&databits=8).
Millis() is not affected, only micros() and delay(). Micros() executes equally fast at all clock speeds, but returns wrong values with anything that 64 doesn't divide evenly by.
<br/>
<b>**</b> There might be some issues related to the internal oscillator. It's factory calibrated, but may be a little "off" depending on the calibration, ambient temperature and operating voltage. If uploading failes while using the 8 MHz internal oscillator you have three options:
* Edit the baudrate line in the [boards.txt](https://github.com/MCUdude/MiniCore/blob/3ba977a7c6f948beff5a928d7f11a627282779e2/avr/boards.txt#L83) file, and choose either 115200, 57600, 38400 or 19200 baud.
* Upload the code using a programmer (USBasp, USBtinyISP etc.) or skip the bootloader by holding down the shift key while clicking the "Upload" button
* Use the 1 MHz option instead
## BOD option
Brown out detection, or BOD for short lets the microcontroller sense the input voltage and shut down if the voltage goes below the brown out setting. To change the BOD settings you'll have to connect an ISP programmer and hit "Burn bootloader". Below is a table that shows the available BOD options:
<br/>
| ATmega328 | Atmega168 | ATmega88 | ATmega48 | ATmega8 |
|-----------|-----------|----------|----------|----------|
| 4.3v | 4.3v | 4.3v | 4.3v | 4.0v |
| 2.7v | 2.7v | 2.7v | 2.7v | 2.7v |
| 1.8v | 1.8v | 1.8v | 1.8v | - |
| Disabled | Disabled | Disabled | Disabled | Disabled |
## Link time optimization / LTO
After Arduino IDE 1.6.11 where released, There have been support for link time optimization or LTO for short. The LTO optimizes the code at link time, making the code (often) significantly smaller without making it "slower". In Arduino IDE 1.6.11 and newer LTO is enabled by default. I've chosen to disable this by default to make sure the core keep its backwards compatibility. Enabling LTO in IDE 1.6.10 and older will return an error.
I encourage you to try the new LTO option and see how much smaller your code gets! Note that you don't need to hit "Burn Bootloader" in order to enable LTO. Simply enable it in the "Tools" menu, and your code is ready for compilation. If you want to read more about LTO and GCC flags in general, head over to the [GNU GCC website](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html)!
## Programmers
Mini does not adds its own copies of all the standard programmers to the "Programmer" menu. Just select one of the stock programmers in the "Programmers" menu, and you're ready to "Burn Bootloader" or "Upload Using Programmer".
Select your microcontroller in the boards menu, then select the clock frequency. You'll have to hit "Burn bootloader" in order to set the correct fuses and upload the correct bootloader. <br/>
Make sure you connect an ISP programmer, and select the correct one in the "Programmers" menu. For time critical operations an external oscillator is recommended.
## Write to own flash
A while ago [@majekw](https://github.com/majekw) announced that he'd [successfully modified the Optiboot bootloader](http://forum.arduino.cc/index.php?topic=332191.0) to let the running program permanently store content in the flash memory.
The flash memory is much faster than the EEPROM, and can handle about 10 000 write cycles before it's worn out. <br/>
To enable this feature your original bootloader needs to be replaced by the new one. Simply hit "Burn Bootloader", and it's done! <br/>
Please check out the [Optiboot flasher example](https://github.com/MCUdude/MiniCore/tree/master/avr/libraries/Optiboot_flasher/examples/SerialReadWrite) for more info about how this feature works, and how you can try it on your MiniCore compatible microcontroller.
## How to install
#### Boards Manager Installation
This installation method requires Arduino IDE version 1.6.4 or greater.
* Open the Arduino IDE.
* Open the **File > Preferences** menu item.
* Enter the following URL in **Additional Boards Manager URLs**:
```
https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json
```
* Open the **Tools > Board > Boards Manager...** menu item.
* Wait for the platform indexes to
没有合适的资源?快使用搜索试试~ 我知道了~
MiniCore-master.zip_MiniCore_arduino_avr_preventjss_单片机
共100个文件
hex:64个
ino:8个
txt:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 15 浏览量
2022-07-15
14:07:41
上传
评论
收藏 158KB ZIP 举报
温馨提示
AVR 单片机MiniCore Arduino核心库文件。
资源详情
资源评论
资源推荐
收起资源包目录
MiniCore-master.zip_MiniCore_arduino_avr_preventjss_单片机 (100个子文件)
omake.bat 60B
optiboot_flash.c 38KB
baudcheck.c 2KB
avrdude.conf 68KB
SoftwareSerial.cpp 16KB
.gitignore 10B
boot.h 33KB
pin_defs.h 17KB
pins_arduino.h 8KB
optiboot.h 6KB
SoftwareSerial.h 4KB
stk500.h 2KB
AVR_keywords.h 76B
optiboot_flash_atmega88p_38400_8000000L.hex 1KB
optiboot_flash_atmega88p_115200_18432000L.hex 1KB
optiboot_flash_atmega168p_38400_8000000L.hex 1KB
optiboot_flash_atmega88_38400_8000000L.hex 1KB
optiboot_flash_atmega168p_115200_18432000L.hex 1KB
optiboot_flash_atmega168p_57600_8000000L.hex 1KB
optiboot_flash_atmega88_19200_8000000L.hex 1KB
optiboot_flash_atmega328p_115200_16000000L.hex 1KB
optiboot_flash_atmega168p_19200_8000000L.hex 1KB
optiboot_flash_atmega88_115200_18432000L.hex 1KB
optiboot_flash_atmega88_115200_16000000L.hex 1KB
optiboot_flash_atmega88p_57600_12000000L.hex 1KB
optiboot_flash_atmega328p_57600_12000000L.hex 1KB
optiboot_flash_atmega328p_9600_1000000L.hex 1KB
optiboot_flash_atmega328_38400_8000000L.hex 1KB
optiboot_flash_atmega88_57600_12000000L.hex 1KB
optiboot_flash_atmega88_9600_1000000L.hex 1KB
optiboot_flash_atmega88_57600_8000000L.hex 1KB
optiboot_flash_atmega88p_57600_8000000L.hex 1KB
optiboot_flash_atmega88p_19200_8000000L.hex 1KB
optiboot_flash_atmega88p_115200_16000000L.hex 1KB
optiboot_flash_atmega328p_115200_20000000L.hex 1KB
optiboot_flash_atmega88p_115200_20000000L.hex 1KB
optiboot_flash_atmega328p_19200_8000000L.hex 1KB
optiboot_flash_atmega88p_115200_8000000L.hex 1KB
optiboot_flash_atmega328p_57600_8000000L.hex 1KB
optiboot_flash_atmega168p_115200_16000000L.hex 1KB
optiboot_flash_atmega328_115200_20000000L.hex 1KB
optiboot_flash_atmega88_115200_20000000L.hex 1KB
optiboot_flash_atmega328_9600_1000000L.hex 1KB
optiboot_flash_atmega328_19200_8000000L.hex 1KB
optiboot_flash_atmega168p_9600_1000000L.hex 1KB
optiboot_flash_atmega328p_115200_8000000L.hex 1KB
optiboot_flash_atmega168p_115200_20000000L.hex 1KB
optiboot_flash_atmega328p_115200_18432000L.hex 1KB
optiboot_flash_atmega168p_115200_8000000L.hex 1KB
optiboot_flash_atmega328_115200_18432000L.hex 1KB
optiboot_flash_atmega328_115200_8000000L.hex 1KB
optiboot_flash_atmega328_57600_12000000L.hex 1KB
optiboot_flash_atmega328p_38400_8000000L.hex 1KB
optiboot_flash_atmega328_57600_8000000L.hex 1KB
optiboot_flash_atmega88p_9600_1000000L.hex 1KB
optiboot_flash_atmega328_115200_16000000L.hex 1KB
optiboot_flash_atmega168p_57600_12000000L.hex 1KB
optiboot_flash_atmega88_115200_8000000L.hex 1KB
optiboot_flash_atmega168_57600_8000000L.hex 1KB
optiboot_flash_atmega168_115200_20000000L.hex 1KB
optiboot_flash_atmega168_115200_16000000L.hex 1KB
optiboot_flash_atmega168_115200_8000000L.hex 1KB
optiboot_flash_atmega168_57600_12000000L.hex 1KB
optiboot_flash_atmega168_9600_1000000L.hex 1KB
optiboot_flash_atmega168_38400_8000000L.hex 1KB
optiboot_flash_atmega168_19200_8000000L.hex 1KB
optiboot_flash_atmega168_115200_18432000L.hex 1KB
optiboot_flash_atmega8_38400_8000000L.hex 1KB
optiboot_flash_atmega8_57600_8000000L.hex 1KB
optiboot_flash_atmega8_115200_8000000L.hex 1KB
optiboot_flash_atmega8_19200_8000000L.hex 1KB
optiboot_flash_atmega8_115200_18432000L.hex 1KB
optiboot_flash_atmega8_9600_1000000L.hex 1KB
optiboot_flash_atmega8_115200_16000000L.hex 1KB
optiboot_flash_atmega8_57600_12000000L.hex 1KB
optiboot_flash_atmega8_115200_20000000L.hex 1KB
empty.hex 27B
SerialReadWrite.ino 9KB
TwoPortReceive.ino 3KB
Blink.ino 2KB
Measure_period_length.ino 2KB
Blink_using_Timer0.ino 2KB
Watch_dog_timer.ino 1KB
SoftwareSerialExample.ino 1KB
Read_port_write_port.ino 523B
LICENSE 39KB
makeall 6KB
Makefile 11KB
README.md 12KB
omake 199B
library.properties 586B
library.properties 232B
library.properties 198B
keywords.txt 38KB
boards.txt 18KB
platform.txt 7KB
README.TXT 4KB
externalprogrammers.txt 3KB
Readme.txt 972B
keywords.txt 742B
共 100 条
- 1
APei
- 粉丝: 63
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
- 以下是一个简化的示例,它使用pygame库来模拟烟花动画的框架.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0