Compiling/Loading with Atmel Studio and an Atmel ICE JTag
I'm using the SoftwareSerial to add an UART to the board. I need it, hardware serial already used.
The communication using the Soft Serial is ok, until it unexpectedly change speed, I do not know why...
The communication is supposed to be at 38400, about 26µs for a bit. I check it by changing a GPIO when the driver is sampling data. The GPIO change state every 26µs.
But suddenly, the sampling change to a new fixed value of 4.3ms!
First I thought it was because of overload of the µC. But I made a check:
SoftwareSerial defined a timing inter bit _rx_delay_intrabit that is set to 99 when working at 38400Bds
When the Serial change it own speed, this value change (I made a GPIO changing its state if value is different from 99)
So it is like there was a new call to Serial.begin (only methode to change _rx_delay_intrabit value). But there is no call of this methode (add a break point in it)
Any ideas what could cause this problem? Or anything other to check?
Thank you
You've probably stomped on memory you don't own, writing past the end of an array or writing to an uninitialized pointer.
But, of course, that's just a guess because, despite posting code being a requirement for posting in the Programming section, you failed to post any code.
One interface connected to the USB is used to display some trace on my terminal.
The other Hardware Uart is used to communicate with another device.
And sorry for not showing my code, but unfortunately I am not allowed to show it... but anyway it is quiet large so I do not think it could help... Maybe I post to the wrong section of the forum!
I will have a look to check all the array writing to avoid memory corruption!
Thank you
No it is not a commercial project. Theres is two network here, one for work, one for internet. And I am not allowed to transfert anything from one to the other...
I have a function call that will send a command to an Arduino GSM shield via the SoftwareSerial.
gsm_send( bufferCommand, answer, index)
The call of the function is made like that (index is a param, value is 1, answer is a tab defined and initialized):
When working with the sprintf, the command in "buffer" is correct. buffer is large enough to perform the sprintf(buffer, "%s%d", READ_SMS, index) without overflow. So I do not understand what could be wrong...
AntoineCa:
No it is not a commercial project. Theres is two network here, one for work, one for internet. And I am not allowed to transfert anything from one to the other...
How about taking the code home and doing it on your own personal PC where there are no restrictions.
Expecting people to help with code we cannot see is ridiculous.