Hi J,Show the loop, where you got the values in #1111
It seems that you increment #s2m by 2
That was the same LOOP, but with '#'
C.
Hi J,Show the loop, where you got the values in #1111
It seems that you increment #s2m by 2
Hi J,I don't believe it is voltage related, because the error happens always at the same last bit.
Could be framing error?
Do you use a crystal oscillator or internal oscillator?
HSEROUT does work in the SIM. I just tested it. You just have to wait enough clock cycles for it to send the data. Your code runs in the sim based on clock cycles (micro seconds). UART sends a character about every 1ms at 9600 baud, so your code keeps running while the HSEROUT data shows up a bit at a time as the code continues to run.Hi J,
I think the radio is fine.
Yes, the terminal is radio connected. The radio will be used for radio control later (If I ever finish)
HSEROUT is not supported by Oshonsoft, so doesn't work in the SIM.
SEROUT works in SIM, but not live.
I also have a listening radio, and there's no sound.
EDIT: Corrected.
C
Hi S,HSEROUT does work in the SIM. I just tested it. You just have to wait enough clock cycles for it to send the data. Your code runs in the sim based on clock cycles (micro seconds). UART sends a character about every 1ms at 9600 baud, so your code keeps running while the HSEROUT data shows up a bit at a time as the code continues to run.
Software serout seems to work better because the CPU in the sim is busy doing the "bit banging", eating up clock cycles to send a single character. In other words, software serial uses CPU to send the data, not allowing any other code to run. Hardware serial passes the data onto the UART register and SIM code continues. The UART register then acts like a separate cpu to send the serial data, at the same time as the main code still runs.
Ok, here's a screen grab of my hardware monitor with the code running as a test. It does send the text ok. Note that the TXbuf and TXshift Reg have the next 2 characters, once the first 2 (t and e) are displayed.Hi S,
Interesting.
When you say "You just have to wait enough clock cycles" I waited 15 Mins and nothing!
Here's a re-try of some days ago tests: It now shows '9' All strange??
C

Hi S,Ok, here's a screen grab of my hardware monitor with the code running as a test. It does send the text ok. Note that the TXbuf and TXshift Reg have the next 2 characters, once the first 2 (t and e) are displayed.
It does display faster than 9600baud, since the SIM just runs through the hardware UART code without waiting for baudrate generator. I find it puts a character out about every 40 to 50uS
The "te" shows up as soon as I step to the waitms 20
View attachment 260043
It is skipping every other HSerout ... ?Hi,
I said in #1109 that it misses '9' but I now see it types it on the second loop. so it does all the digits but out of order?
https://forum.allaboutcircuits.com/...location-pic-in-oshonsoft.148795/post-1706922
C
You use Hserout in the test, but simulate software Serout.Hi S,
Thanks for the test.
I tried and still failed.
What is you UART time setting
Hi J,You use Hserout in the test, but simulate software Serout.
Hi J,It is skipping every other HSerout ... ?
You used Hserout in the test program and Serout in the simulator, which did not work.Hi J,
Can you clarify, is this what you want me to do or what you think I did?
I tried SEROUT and HSEROUT in the SIM. HSEROUT stalls, and SEROUT works. LIVE, SEROUT doesn't work, HSEROUT shows the readings I've been posting.
C
Hi J,You used Hserout in the test program and Serout in the simulator, which did not work.
Only settings are what you see in the program. I notice in your screen shot that you have the software UART monitor open, listening to pin 7 of PortC, which is a hardware UART pin. That may be messing up your test results. Do not use software UART monitor when using the hardware UART monitor in the SIM. That is, don't use both at the same time unless the soiftware UART is on different pins than the hardware UARTHi S,
Thanks for the test.
I tried and still failed.
What is you UART time setting?
C
Hi S,Only settings are what you see in the program. I notice in your screen shot that you have the software UART monitor open, listening to pin 7 of PortC, which is a hardware UART pin. That may be messing up your test results. Do not use software UART monitor when using the hardware UART monitor in the SIM. That is, don't use both at the same time unless the soiftware UART is on different pins than the hardware UART