tuupola / avr_demo Goto Github PK
View Code? Open in Web Editor NEWAtmel demo code. Does not use any Arduino libraries. I want to learn this the hard way (tm).
Home Page: https://appelsiini.net/
Atmel demo code. Does not use any Arduino libraries. I want to learn this the hard way (tm).
Home Page: https://appelsiini.net/
“__builtin_avr_delay_cycles expects a compile time integer constant”
I looked that up in avr_libc documentation for<util/delay.h> and found this:
"The implementation of _delay_ms() based on __builtin_avr_delay_cycles() is not backward compatible with older implementations.”
Adding the macro DELAY_BACKWARD_COMPATIBLE fixed it.
When using the UART async mode example, I'm missing the first of all char in serial monitor.
The normal UART example (without ring buffer) works fine.
A license on this github project would help readers of your blog know where they stand with following and using the tutorials/demos.
Error message #1: “return type of 'main' is not 'int’”
In main.c, I changed uint8_t to int and the problem went away.
/* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
int uart_putchar(char c, FILE *stream); // <=======//// RIGHT HERE
int uart_getchar(FILE *stream); // <=======//// AND HERE
// ////REQUIRED BY ======v===================v
FILE uart_output = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
FILE uart_input = FDEV_SETUP_STREAM(NULL,uart_getchar, _FDEV_SETUP_READ);
void uart_init(void) {
UBRR0H = UBRRH_VALUE;
UBRR0L = UBRRL_VALUE;
UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); /* 8-bit data */
UCSR0B = _BV(RXEN0) | _BV(TXEN0); /* Enable RX and TX */
}
int uart_putchar(char c, FILE *stream) {
if (c == '\n') {
uart_putchar('\r', stream);
}
loop_until_bit_is_set(UCSR0A, UDRE0);
UDR0 = c;
return 0;
}
int uart_getchar(FILE *stream) {
loop_until_bit_is_set(UCSR0A, RXC0);
return UDR0;
}
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.