You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aurora.apache.org by Manal Khaled <m....@yahoo.com.INVALID> on 2016/01/07 22:29:30 UTC
Transmit a packet
HiI have written an algorithm in c format and i tested in Avrora successfully using obj-dump utility. Now, I want to send the result of the algorithm (usually 1 byte or 2) as a notification to the receiver. I assume i have only 2 nodes. I try to use the following code but it gives an error when i use obj-dump to turn from .c to .ob file.. any help please?#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
int main (void)
{
UCSRB = (1 << RXEN) | (1 << TXEN); // Turn on the transmission and reception circuitry
UCSRC = (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit character sizes
UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register
UBRRL = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value into the low byte of the UBRR register
for (;;) // Loop forever
{
}
}
Re: Transmit a packet
Posted by Bill Farner <wf...@apache.org>.
Are you sure you have the correct mailing list? This is for Aurora,
cluster management system: https://aurora.apache.org/
On Thu, Jan 7, 2016 at 1:29 PM, Manal Khaled <m....@yahoo.com.invalid>
wrote:
> HiI have written an algorithm in c format and i tested in Avrora
> successfully using obj-dump utility. Now, I want to send the result of the
> algorithm (usually 1 byte or 2) as a notification to the receiver. I assume
> i have only 2 nodes. I try to use the following code but it gives an error
> when i use obj-dump to turn from .c to .ob file.. any help please?#define
> USART_BAUDRATE 9600
> #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
>
> int main (void)
> {
> UCSRB = (1 << RXEN) | (1 << TXEN); // Turn on the transmission
> and reception circuitry
> UCSRC = (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit
> character sizes
>
> UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud
> rate value into the high byte of the UBRR register
> UBRRL = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value
> into the low byte of the UBRR register
>
> for (;;) // Loop forever
> {
>
> }
> }