ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
arduino_uno_write_pattern_to_serial.c
1#include "asc_helpers.h"
2#include "avr/avr_uart.h"
3#include <avr/io.h>
4
5#define F_CPU 16000000L
6#include <util/delay.h>
7#define FOSC 16000000L
8#define BAUD 9600
9#define MYUBRR (FOSC / 16 / BAUD - 1)
10#define UART_NO 0
11
12uint8_t byteBuffer;
13
14int main(void) {
15
16 UART_Init(UART_NO, MYUBRR, 0);
17
18 byteBuffer = 48;
19 while (1) {
20 uart_tx_blocking(UART_NO, byteBuffer);
21 byteBuffer++;
22 if (byteBuffer > 57) {
23 byteBuffer = 48;
24 //_delay_ms(100);
25 }
26 }
27 return 0;
28}
#define uart_tx_blocking(uart_no, _tmp_byte)
#define UART_Init(uart_no, ubrr, rxIntEnable)
Initialize USART.
Definition avr_uart.h:20