I gang

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);

}

}

Færdigheder: C programmering

Se mere: sam4s, interrupt sam4s, sam4s code, atmel uart_init, sam4s usart0, write on communications, serial programming, programming in r, get in c programming, data driven programming, c for int, atmel job, atmel c programming, asynchronous programming, code atmel interrupt rs232, test on r programming, Serial, rs232, ek, communications, c r, atmel, receive serial data, rs232 program, simple serial

Om arbejdsgiveren:
( 23 bedømmelser ) Brighton, United Kingdom

Projekt-ID: #4108227

Tildelt til:

Tauseef240

Hi, I can do it.

$100 USD in 2 dage
(12 bedømmelser)
4.7

3 freelancere byder i gennemsnit $167 for dette job

yhaat

Hi, I can help.

$200 USD in 15 dage
(6 bedømmelser)
4.2
mikhailsadowski

Can do your work.

$200 USD in 10 dage
(0 bedømmelser)
3.3