ESTE: UART - Interrupts and Circular Buffer: mudanças entre as edições
Ir para navegação
Ir para pesquisar
Sem resumo de edição |
Sem resumo de edição |
||
Linha 1: | Linha 1: | ||
This experiment is part of [[Embedded_Systems_Experiments_for_the_Telecommunication_Engineering_Course|this project]]. | This experiment is part of [[Embedded_Systems_Experiments_for_the_Telecommunication_Engineering_Course|this project]]. | ||
To complete this experiment it is recommended to see at first the [http://wiki.sj.ifsc.edu.br/index.php/ESTE:_UART_-_Basic_Interrupts UART - Basic Interrupts] script. | |||
==Pseudo code== | ==Pseudo code== |
Edição das 09h13min de 15 de outubro de 2015
This experiment is part of this project.
To complete this experiment it is recommended to see at first the UART - Basic Interrupts script.
1 Pseudo code
Let's begin with a solution. The pseudo code (actual coding is up to you) is below:
int main(void) {
byte incomingByte;
baud_rate = 9600;
while(1) {
led_off();
}
return 0;
}
void serial_interrupt_event() {
if (data_available_on_input_field()) {
incomingByte = read_data_on_input_field();
println(incomingByte);
led_on();
}
}
This pseudo-code has a comparison statement to check if there are data available on the input field of the serial monitor, i.e serial port. If so, the data available will be stored on the memory, printed - only for debuging- and the led will be lighted on.
2 Schematic

3 Part List
- 1 LED
- 1 220 ohm resistor for the led
- 1 Protoboard
- 2 copper wires (tinned) or jumpers
4 Assembly
