Go Down

Topic: Slow communications.  VB6 to Arduino (Read 1 time) previous topic - next topic

CodeVB6

Thanks guys,  I have been able to increase the RX butter by changing the RX_Butter_SIZE in HardwareSerial.cpp but I found that if in go over 256 then the Serial.available() command does not report out correctly.  

I was able to fix that by changing line 168 in HardwareSerial.cpp from  "uint8_t HardwareSerial::available(void)"   to  "uint16_t HardwareSerial::available(void)" .
And also changing line 50 in HardwareSerial.h from  "uint8_t available(void);"  to  "uint16_t available(void);" .

I can't believe that I figured that out on my own.  I am now running a 1024 byte buffer with no problems at all.   I have also bumped the com speed up to 230400 and it is still working with no data errors.  I didn't know little Arduino could run that fast.  

Note:  The actual RX buffer size is one less then what is in RX_BUFFER_SIZE.  
Example:  If you want a true 128 byte buffer use RX_BUFFER_SIZE 129.

MikMo

Now that's cool!

How much memory (RAM) is left for your programs other needs ?

CodeVB6

I don't know.  I never figured out how to tell.  The ATmega328 has 2K of RAM and I am using half of it for the buffer.  Fortunately my program does not use much.

Go Up