spencekonde / arduino-tiny-841 Goto Github PK
View Code? Open in Web Editor NEWArduino core for ATtny841, 828, 1634 and 441
Home Page: http://drazzy.com/e/tiny841.shtml
License: Other
Arduino core for ATtny841, 828, 1634 and 441
Home Page: http://drazzy.com/e/tiny841.shtml
License: Other
841 uses the PUE register to enable pullups on pins, instead of the old scheme of setting pin as input but telling it to output high. Thus, input_pullup won't work until this is fixed.
"okay, it's time to actually merge these fucking cores already".
Could I take a major copout w/regards to merging them by doing the following?
In one of the cores, rename avr/cores/tiny to avr/cores/tinymodern (for example), and adjust boards.txt appropriately. Then just copy the other core's avr/cores/tiny to that one, and concatenate the boards.txt entries...
That would work right? Is that smart?
Via email - copied relevant portion here for comment:
I think merging the cores should be easy enough, I'm not sure if the libraries need merging also or if they are interchangeable. As far as Boards Manager goes I can see two approaches:
- Don't provide any more updates to one of the two packages(I'd guess ATtiny Modern since ATTinyCore has a more appropriate name). The problem with this is that the users on the dropped package will be left out of any further updates if they don't realize what happened and install the other package. I would be nice if there was a way to display release notes on Boards Manager updates(other than the "More info" link). Closest thing to that would be to put a note in "Boards included in this package" or I think I can put "(Deprecated)" after the Boards Manager entry name.
- Update the entries in the JSON file for each package identically on each release of the merged core. This won't leave anyone behind but would cause redundant Tools > Board menu entries for people who have both cores installed.
Libraries are interchangeable, that's no prob. All the rest of the cores are different from eachother, though :-P
Okay. So I'll try to merge them both into ATTinyCore then, and try to make sure it works. I'll meditate on the topic of which way to go.
When compiling, the Arduino IDE 1.6.6 (latest version) returns a warning :
Warning: platform.txt from core 'ATtiny Modern' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
The problem is that the line 65 in platform.txt use an outdated syntax (more precisely an outdated variable of the Arduino IDE)
Please consider updating the original line :
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
by :
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
Thanks !
P.S. : Sorry for my english, I'm French ๐
From README.md:
Modifying avrdude.conf should no longer be necessary, ever as of 8/22/2015 changes.
This is still necessary, at least on OSX running Arduino 1.6.7 (which is the latest version at time of writing).
How should we revise so that this is known?
Already have images for 841 and 1634, just need to use them, and add one for 828.
Running Arduino 1.6.7 on OSX, I see the following warnings when compiling for ATtiny841:
Warning: platform.txt from core 'ATtiny Modern' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
Warning: platform.txt from core 'ATtiny Modern' contains deprecated recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}", automatically converted to recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}". Consider upgrading this core.
I'm assuming the command to which it is automatically converted can directly replace the old command in this codebase, but I haven't investigated further.
All the more reason to fix #7 with a sense of urgency.
No surprise here, seeing as we need to control TOCCR and we ain't doin' that.
It turns out that that lovely +/- 2% spec on the oscillator on 1634R and the 841 is only valid below 4V, and above 4V, it the internal oscillator speed increases enough to break UART.
I think the solution is board def and bootloader with F_CPU=8100000L - though an alternative would be a bootloader that looked at factory OSCCAL and nudged it down to bring it back to somewhere "around" 8mhz.... Either way, it's a different bootloader for ~5v off internal oscillator!
Serial config values (SERIAL_8N1
, SERIAL_5N2
etc) passed as the second (optional) argument to Serial.begin(speed, config)
(and some other libraries like modbus-arduino) are missing from this core.
In the official core these are defined in: https://github.com/arduino/Arduino/blob/26e25a4d58ff1a970d4790e5ccc3a5f4c3dea398/hardware/arduino/avr/cores/arduino/HardwareSerial.h#L67-L91
Building the bootloader is easy. Trying to figure out how to integrate it with the menu system is trickier...
Need pin definitions in arduino_pins.c and .h
And while I wrote attiny841_i2c_analog I noticed there are typo in core_adc.h:
*** core_adc.h-old Tue May 19 16:08:23 2015
--- core_adc.h Tue May 19 16:10:26 2015
*** 371,380 ****
ADC_Input_ADC5 = B0101,
ADC_Input_ADC6 = B0110,
ADC_Input_ADC7 = B0111,
! ADC_Input_ADC8 = B0111,
! ADC_Input_ADC9 = B0111,
! ADC_Input_ADC10 = B0111,
! ADC_Input_ADC11 = B0111,
ADC_Input_GND = B1100, // 0V (AGND)
ADC_Input_1p1 = B1101, // 1.1V (I Ref)
--- 371,380 ----
ADC_Input_ADC5 = B0101,
ADC_Input_ADC6 = B0110,
ADC_Input_ADC7 = B0111,
! ADC_Input_ADC8 = B1000,
! ADC_Input_ADC9 = B1001,
! ADC_Input_ADC10 = B1010,
! ADC_Input_ADC11 = B1011,
ADC_Input_GND = B1100, // 0V (AGND)
ADC_Input_1p1 = B1101, // 1.1V (I Ref)
The readme instructs readers to move the "cores" and "bootloaders" folders into the newly created "avr" directory. "boards.txt" and "platform.txt" (and probably "programmers.txt") also need to be moved into the "avr" directory.
So ya, we should do that!
Requires including an avrdude.conf, and pointing the IDE to it with platforms.txt
Add bootloader for 9.216, 11.05... and 14.3... mhz UART clocks for 841 & 1634
Add options to clock menu
Per jboynton on pg7: http://forum.arduino.cc/index.php?topic=304606.90
Also needs to be fixed in other ATTiny core.
I tested SoftwareSerial on an ATtiny841. I tried three different baud rates and changed the system oscillator frequency by tuning the internal 8MHz oscillator calibration registers. What I found was that SoftwareSerial seemed to work at these frequencies:
9600: 7.5-8.5 MHz
19.2: 7.9-8.6 MHz
38.4: 7.6-7.7 MHz
This seemed weird since I'd only recently tested an Atmega328 and the results were different. I finally came to realize that SoftwareSerial had undergone a change with 1.6.x IDE. It appears to have been an improvement. The 1.6.x 841 core uses the older 1.0.x SoftwareSerial.
Using the 1.6.x SoftwareSerial I got these values:
9600: 7.6-8.4 MHz
19.2: 7.6-8.3 MHz
38.4: 7.8-8.2 MHz
The frequencies aren't highly precise because the internal oscillator has a lot of jitter. But the ranges where it worked were better centered around 8Mhz with the 1.6.x version. Also, the 1.6.x SoftwareSerial is 306 bytes smaller in code size. It uses only 3 bytes extra RAM.
I copied SoftwareSerial.cpp and .h into my hardware/arduino-tiny-841 folder. But rather than have this duplication, is there any way to set up the core so that the SoftwareSerial library in the 1.6.x core is used instead?
delay() uses micros(), and micros() is getting integer-math'ed.
Pass a define via a menu for 841, and if that's defined, set REMAP in init() appropriately and change the MISO/MOSI/SCK defines.
Would need to also adjust the PWM pins, I think.
Hi,
I'm using the recently updated core for the Attiny1634 and I'm seeing some strange serial output when using 8 MHz oscillator. That doesn't happen with 1 MHz oscillator.
Thanks!
I've got my fuses set at 8MHz, internal oscillator. I did find the bootloader requirement, but I'd already set them manually with avrdude. Did a bootloader burn for good measure.
I've got the blink sketch flashed, using PA0.
When the sketch is running, I can see the voltage going from 0.2-to 0.5 volts, with the proper timing - 1 second on, 1 second off.
I have a 0.1uF right next to the power pins....
A real head scratcher.
Something is severely wrong with new boards.txt and platform.txt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.