RonHackett
Member
I have been playing around with the 14M2 storage variables and indirect addressing, and using the Terminal Window to observe the results. I'm having a weird issue that I hope someone can either confirm, or explain what I may be doing wrong. The easiest way to illustrate the issue is with a simple "HelloWorld" program:
First of all, the pause statement seems to be necessary. If I remove it (or shorten it), the Terminal Window fails to display the Hello string at all. It could be that this is the first time I have ever tried to immediately send a string to the Terminal Window when a program first runs, so I don't know if a delay has always been required when the Terminal Window first starts up. That may well be, because I tried the same program on a 14M, and the delay was again necessary. In any case, including a delay is not a problem.
The real issue is that, whenever the Terminal Window first opens after a new program download to the 14M2, I get a single "garbage" character displayed in front of the "Hello world!" string. I accidentally discovered that this issue is connected to the "#no_data" directive. If it's removed, the garbage character disappears; if it's there, so's the garbage!
I also discovered that a 4k7 pull-down resistor on the 14M2 serout line solves the problem; the "#no_data" directive can be included, and the Terminal Window does not display the garbage character. That's an easy enough solution, but I would just like to understand what's going on. Is this really an issue with the 14M2, or am I missing something else that would explain what's happening?
Thanks...
Ron
Code:
#com 6
#picaxe 14M2
#no_data
#terminal 9600
main:
setfreq m8
pause 650
sertxd ("Hello world!")
The real issue is that, whenever the Terminal Window first opens after a new program download to the 14M2, I get a single "garbage" character displayed in front of the "Hello world!" string. I accidentally discovered that this issue is connected to the "#no_data" directive. If it's removed, the garbage character disappears; if it's there, so's the garbage!
I also discovered that a 4k7 pull-down resistor on the 14M2 serout line solves the problem; the "#no_data" directive can be included, and the Terminal Window does not display the garbage character. That's an easy enough solution, but I would just like to understand what's going on. Is this really an issue with the 14M2, or am I missing something else that would explain what's happening?
Thanks...
Ron