Sedang Disiapkan

Interrupt Serial Communications for Atmel SAM4S in C

Write a program to send and receive serial data using interrupts on the 2 uarts and 2 usarts of the Atmel SAM4S processor.

An easy job if you know these processors!

I have a SAM4S-EK kit to test the code on.

The code must be interrupt driven for receive and transmit.

The code must run in asynchronous mode (to allow RS232 communications).

The interface should be simple, like this

uart_init(uart_id, rx_buffer_size, tx_buffer_size, baud_rate);

send_byte(uart_id, b); // send byte into buffer for interrupt to transmit

available(uart_id); // check for received data

read_byte(uart_id); // get byte from receive buffer

A test should be written like this

uart_init(UART0, 100, 100, 9600);

uart_init(UART1, 100, 100, 9600);

uart_init(USART0, 100, 100, 9600);

uart_init(USART1, 100, 100, 9600);

while (1)

{

if (available(UART0))

{

int b = read_byte(UART0);

send_byte(UART1, 'R');

send_byte(UART1, b);

}

if (available(UART1))

{

int b = read_byte(UART1);

send_byte(UART0, 'R');

send_byte(UART0, b);

}

if (available(USART0))

{

int b = read_byte(USART0);

send_byte(USART1, 'R');

send_byte(USART1, b);

}

if (available(USART1))

{

int b = read_byte(USART1);

send_byte(USART0, 'R');

send_byte(USART0, b);

}

}

Kemahiran: Pengaturcaraan C

Lihat lebih lanjut: sam4s, interrupt sam4s, sam4s code, sam4s usart0, write communications, serial programming, data driven programming, atmel job, asynchronous programming, code atmel interrupt rs232, test programming, serial, rs232, ek, communications, c r, atmel, receive serial data, rs232 program, simple serial, rs232 serial, programming rs232, data communications, interface rs232, atmel programming

Tentang Majikan:
( 23 ulasan ) Brighton, United Kingdom

ID Projek: #4108227

Dianugerahkan kepada:

Tauseef240

Hi, I can do it.

$100 USD dalam 2 hari
(12 Ulasan)
4.7

3 pekerja bebas membida secara purata $167 untuk pekerjaan ini

yhaat

Hi, I can help.

$200 USD dalam 15 hari
(6 Ulasan)
4.2
mikhailsadowski

Can do your work.

$200 USD dalam 10 hari
(0 Ulasan)
3.3