ralphbacon / 174-attiny13-brain-dead Goto Github PK
View Code? Open in Web Editor NEWToo small to program? Watch the video and find out!
License: GNU General Public License v3.0
Too small to program? Watch the video and find out!
License: GNU General Public License v3.0
I did watch your Youtube video about ATtiny13 + MicroCore, and I'm sorry to say I'm a bit disappointed with your conclusion. Even though MicroCore is very light-weight, the T13 is still very limited in terms of memory. However, it's a great little chip if one really wants to learn how to write efficient code!
OSCCAL:
Ralph Doncaster and I created a very nice OSCCAL sketch that uses a received x
character from the serial monitor to tweak and tune the OSCCAL value. It's very reliable and works great!
You can find this sketch under Examples > Serial Examples > OscillatorCalibration in Arduino IDE if you get the latest MicroCore version.
Another thing to point out is that even though there are two internal oscillators you can still use the OSCCAL value for 9.6 MHz when running at 1.2 MHz (9.6MHz/8), and the 4.8 MHz value when running at 600 kHz (4.8MHz/8).
Serial printing:
The code you host here doesn't really use any of the built-in MicroCore UART functionality. The built-in Serial functionality is smaller and faster, especially the printNumber function. I'm pretty sure it will work like you'd expect if you use it like intended:
/*
PB0 > TX pin
PB1 > RX pin
115200 baud @ 9.6 MHz
57600 baud @ 4.8 MHz
Run the OscillatorCalibration sketch first!
*/
#include <EEPROM.h>
uint32_t counter = 0;
uint8_t small_count = 0;
void setup()
{
// Check if there exist any OSCCAL value in EEPROM addr. 0
// If not, run the oscillator tuner sketch first
uint8_t cal = EEPROM.read(0);
if (cal < 0x80)
OSCCAL = cal;
}
void loop()
{
Serial.print(F("Serial Test ")); // The F macro should be here!
Serial.print(counter);
Serial.println(); // Occupies only 8 bytes
counter++;
small_count++;
delay(1000); // Uses _delay_ms(1) inside a while loop to prevent inlining
}
The problems Ralph Doncaster pointed out were fixed in the end. The problem was that we couldn't reduce the compiled size properly when HalfDuplexSerial inherited Print (Some Arduino builder issue I think). Instead, some of the Print functions were copied over to HalfDuplexSerial. The result is a reduced sketch size with some "backend code" that's not as elegant as I had initially hoped.
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.