I am testing a new board and had to switch to software serial due to a board error. I would like to have a function similar to Hsergetstring that would work with ser1receive. I am at 115200 baud and do get comms back but having difficulty with ser1receive in terms of capturing the data. I have tried 57600 with the same result. I am working with a ESP-12S wifi chip and an ATMEGA328pb. I have looked at the buffer ring example but I can't apply it as I don't have a USART Interrupt that I know of.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I attached a demo for receiving strings with timeout yet without using timers and interrupts. I tested on an Arduino Uno. Maybe you can get it to work on your 328pb.
Thanks for both replies. I implemented Frank's code and it is working great! I am still having an issue with data received via the esp8266 but that may be a topic for another forum. It echos fine and displays 0,CONNECTED when I connect a TCP Client. However the data comes through as garbage. Thanks again for the help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Frank. I am having issue with the 12F1501 projects.
What version of the compiler etc did you use? I am getting Error: Excessive RAM usage! Delete some variables, reduce the size of arrays, or upgrade to a more powerful chip
I have tried 0.98.06 and .05. Yours is?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
These new files are fail on test here. I have gone back to 0.95 and I cannot make is compile. I get not enough memory error.
Can you please upload your installation to a cloud location so I can download? I need to resolve as this is concerning. I don't like releasing when we have odd errors like this.
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do we have a difference in the soft serial .h files? You build will tell us that.
You are right! I played with the calulation-scripts inside my "softserialch1.h" file. Doing that, I noticed some differences in the calling convention of the "Ser1Print" subs and replaced ...
Sub Ser1Print (PrintData As String)
with
Sub Ser1Print (In PrintData As String)
That seem to cause the decrease the RAM-usage in my version. The scandal is, that I forgot about that.
So all we have to do, is to update the three include files with that two letters.
Please test and I will make the bugfix and post the fixed files here.
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The advantages are only noticeable if string-constant printing is done, not for string variable printing. Probably because without "In" the constant has to be copied into a string variable by the compiler (which is also logical because it could be changed).
"example_softuart_12f1501.gcb" uses 30 instead of 43 bytes RAM. The difference of 13 bytes is the number of bytes of the printed text plus one length byte.
I am testing a new board and had to switch to software serial due to a board error. I would like to have a function similar to Hsergetstring that would work with ser1receive. I am at 115200 baud and do get comms back but having difficulty with ser1receive in terms of capturing the data. I have tried 57600 with the same result. I am working with a ESP-12S wifi chip and an ATMEGA328pb. I have looked at the buffer ring example but I can't apply it as I don't have a USART Interrupt that I know of.
You can try to enable interrupts in the dat. As I remember the .dat for this chip is hand crafted. So, add
Ensure those bits/registers are valid. That should fire up the serial interrupt.
Re ser1receive. We need Frank Steinberg to help you.
Hi!
I attached a demo for receiving strings with timeout yet without using timers and interrupts. I tested on an Arduino Uno. Maybe you can get it to work on your 328pb.
Frank
Thanks for both replies. I implemented Frank's code and it is working great! I am still having an issue with data received via the esp8266 but that may be a topic for another forum. It echos fine and displays 0,CONNECTED when I connect a TCP Client. However the data comes through as garbage. Thanks again for the help!
Frank is that demo in the build?
No, it's new. You can add these to the build (2x PIC, 1x AVR):
Added. Thank you. https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/tree/master/Serial_Communications_Solutions/Software_Serial_Optimised_for_Speed_and_Size
@Frank. I am having issue with the 12F1501 projects.
What version of the compiler etc did you use? I am getting
Error: Excessive RAM usage! Delete some variables, reduce the size of arrays, or upgrade to a more powerful chipI have tried 0.98.06 and .05. Yours is?
Mine is 0.98.06
When you have a moment can you send me the ASM from your compiled projects.
Thanks
Attached
Thank you. Still no closer to resolve the error here on test.
Please send your 12F1501.dat file from the
chipdatafolder.Thank you.
This code works (just checked) with direct connection to a native comport.
Chipdata
There is some wrong somewhere.
These new files are fail on test here. I have gone back to 0.95 and I cannot make is compile. I get not enough memory error.
Can you please upload your installation to a cloud location so I can download? I need to resolve as this is concerning. I don't like releasing when we have odd errors like this.
Cheers
Error here using the Gold build back to 0.95. All the same.
Do we have a difference in the soft serial .h files? You build will tell us that.
Ok, found the cause!
You are right! I played with the calulation-scripts inside my "softserialch1.h" file. Doing that, I noticed some differences in the calling convention of the "Ser1Print" subs and replaced ...
with
That seem to cause the decrease the RAM-usage in my version. The scandal is, that I forgot about that.
So all we have to do, is to update the three include files with that two letters.
Please test and I will make the bugfix and post the fixed files here.
Frank
Wow. Well done. That resolves the issue!
Send latest through!
Thank you!
Wow. Well done. That resolves the issue!
Send latest through!
Thank you!
Maybe we should have a look at the "stock" SerPrint too (I cloned SerNPrint from) .
As far as I understand, it may have the same issue. It's called this way (rs232.h):
If you have time. This would be a good idea.
Fixed files:
Last edit: Frank Steinberg 2020-05-08
I will merge and test.
Thank you.
Merged into the Gold BUILD.
All resolved. Well done!
Done for "rs232.h" the same way - same result.
The advantages are only noticeable if string-constant printing is done, not for string variable printing. Probably because without "In" the constant has to be copied into a string variable by the compiler (which is also logical because it could be changed).
"example_softuart_12f1501.gcb" uses 30 instead of 43 bytes RAM. The difference of 13 bytes is the number of bytes of the printed text plus one length byte.