Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
If you send one byte, pause, send another byte, pause, etc, you should be ok. The problem will arise if you stream a large number of bytes without periodically pausing to allow the receiver and transmitter to resync.
If you want sound serial communication at a higher baud, you probably need to have your AVR running faster than 1 MHz.
Out of curiosity, have you tried 38,400 bps with the UART set for double speed? You might be able to packets a few bytes in length using that configuration without losing synchronization.
The Serial Data Input and Serial Data Output operate at the standard 19,200 Baud and the two handshakelines provide optional flow control to and from the host. The Easy-Radio Transceiver can accept and transmitup to 180 bytes of data, which it buffers internally before transmitting in an efficient over-air code format.Any other Easy-Radio Transceiver within range that ?hears? the transmission will decode the message andplace the recovered data within a receive buffer that can then be unloaded to the receiving host forprocessing and interpretation. Transmission and reception are bi-directional half duplex i.e. transmit ORreceive but not simultaneously.
QuoteIf you want sound serial communication at a higher baud, you probably need to have your AVR running faster than 1 MHz.Yea thats why I mentioned getting a crystal . . .
I was thinking of this, but the Easy Radio datasheet mentions nothing on 'asynchronous,' just a list of a few possible baud rates.
Can't you first just try to unprogram the CKDIV8 fuse and run your mega644 off its internal RC oscillator at 8 MHz?
Hmmmm I just looked into the fuses . . . apparently Im using 'Ext. Crystal Osc.; Frequency 8.0 [CKSEL=1111 SUT=11]' . . . and the 'Divide clock by 8 internally; [CKDIV8=0]' box is not checked . . . so does that mean I'm actually already operating at 8Mhz?(sorry for the noob question)
uartInit(); // initialize the UART (serial port)uartSetBaudRate(19200);
So you're saying the "divide clock by 8 internally [CKDIV8=0]" box is unchecked?
//change Easy Radio baud to 38400 delay_cycles(65500); rprintf("ER_CMD#U5");//ER_CMD#U4 for 19200, ER_CMD#U5 for 38400 maximum delay_cycles(6550); rprintf("ACK"); delay_cycles(6550);
Application ErrorException EAccessVioloation in module ER V2_03.exe at 00000000. Access violation at address 00000000. Read of address 00000000.
Since it worked before, you might try rebooting, or backing out the changes you've made recently to the software/ER, or try uninstalling/installing the application/drivers (look for an update).
/****************INITIALIZATIONS*******************/ //other stuff Im experimenting with for SoR uartInit(); // initialize the UART (serial port) uartSetBaudRate(19200);// set the baud rate of the UART for our debug/reporting output rprintfInit(uartSendByte);// initialize rprintf system rprintf("\r\nSystem Warming Up"); //change Easy Radio baud to 38400 delay_cycles(65500); rprintf("ER_CMD#U5");//ER_CMD#U4 for 19200, ER_CMD#U5 for 38400 maximum delay_cycles(6550); rprintf("ACK"); delay_cycles(65500); uartSetBaudRate(38400); delay_cycles(5000);
update sensors();//adds values to t1, t2, r1, etc.rprintf("%d %d %d %d %d %d %d %d \r\n",t1,t2,r1,r2,r4,r5,bk,TCNT0);
update sensors();//adds values to t1, t2, r1, etc.rprintf("%d %d %d %d \r\n",t1,t2,r1,TCNT0);
The Easy-Radio Transceiver can accept and transmit up to 180 bytes of data, which it buffers internally before transmitting in an efficient over-air code format.
while(PORT_IS_ON(PORTC,7)){};//allow data to only transmit when pin is lowrprintf("%d %d %d %d %d %d %d %d \r\n",t1,t2,r1,r2,r4,r5,bk,elapsed_time);//buffer overflow?
Also, it could help if you try transmitting something like "abcdefghi...". That way, the result of the transition might give you more insight into the nature of the failure.
rprintf("\r\nSystem Warming Up"); //let system stabelize for X time for(i=0;i<=8;i++) // 65500*1.003/234*8 = 2.2 seconds { delay_cycles(65500);//~280 milliseconds rprintf("."); } rprintf("\r\nabcdefghijklmnopqrstuvwxyz1234"); //same as above rprintf of output data code goes here//
Are you sure you're not actually trying to print faster than 30 times per second?
// buffer memory allocation defines// buffer sizes#ifndef UART_TX_BUFFER_SIZE//! Number of bytes for uart transmit buffer./// Do not change this value in uart.h, but rather override/// it with the desired value defined in your project's global.h#define UART_TX_BUFFER_SIZE 0x0040
rprintf("\r\nabcdef");rprintf("\r\n123456");rprintf("\r\nabcdef");//followed by data output code
rprintf("\r\nabcdef");delay_cycles(6550);rprintf("\r\n123456");delay_cycles(6550);rprintf("\r\nabcdef");delay_cycles(6550);//followed by data output code
you aren't overriding this UART_TX_BUFFER_SIZE value in your project's global.h file, are you?
I still recommend you see what the output is when you send a less-repetitive sequence of bytes, such as "abcde..."
approximately how many total bytes are you attempting to send with each transmission cycle?
QuoteI still recommend you see what the output is when you send a less-repetitive sequence of bytes, such as "abcde..."I thought I did this . . . what do you mean exactly? Can you give me some code for it?
For example, make a program that just uses rprintf to transmit a single fixed byte sequence to hyperterm. Increase the length of of the byte sequence until it fails and observe what happens when at the moment you cross the failure threshold.
delay_cycles(30000);rprintf("\r\n12345678901234567890123456789012345678901234567");delay_cycles(30000);rprintf("\r\n123456789012345678901234567890123456789012345678");delay_cycles(30000);rprintf("\r\n1234567890123456789012345678901234567890123456789");delay_cycles(30000);rprintf("\r\n12345678901234567890123456789012345678901234567890");delay_cycles(30000);rprintf("\r\n123456789012345678901234567890123456789012345678901");delay_cycles(30000);rprintf("\r\n1234567890123456789012345678901234567890123456789012");delay_cycles(30000);rprintf("\r\n12345678901234567890123456789012345678901234567890123");delay_cycles(30000);rprintf("\r\n123456789012345678901234567890123456789012345678901234");delay_cycles(30000);rprintf("\r\n1234567890123456789012345678901234567890123456789012345");delay_cycles(30000);rprintf("\r\n12345678901234567890123456789012345678901234567890123456");delay_cycles(30000);rprintf("\r\n123456789012345678901234567890123456789012345678901234567");delay_cycles(30000);
while(a2dConvert8bit(3) > 128){};//allow data to only transmit when pin is low//output code goes here