Closed

Interrupt Serial Communications for Atmel SAM4S in C

This project was awarded to Tauseef240 for $100 USD.

Get free quotes for a project like this
Employer working
Awarded to:
Skills Required
Project Budget
$30 - $250 USD
Total Bids
3
Project Description

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

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online