GithubHelp home page GithubHelp logo

tuupola / avr_demo Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 62.0 456 KB

Atmel demo code. Does not use any Arduino libraries. I want to learn this the hard way (tm).

Home Page: https://appelsiini.net/

Makefile 57.58% C 23.13% C++ 19.19% Objective-C 0.10%

avr_demo's People

Contributors

esromneb avatar tuupola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avr_demo's Issues

4x4_matrix_part_1: compiler error RE: __builtin_avr_delay_cycles

“__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.

usart async missing the first char

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.

Please add a license

A license on this github project would help readers of your blog know where they stand with following and using the tutorials/demos.

Functions Prototypes Required By in uart.c FDEV_SETUP_STREAM();

include <avr/io.h>

include <stdio.h>

ifndef BAUD

define BAUD 9600

endif

include <util/setbaud.h>

/* 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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.