HSERIN/OUT commands opened up a Serial Window when I executed them in ICD. At first glance I can't see what is wrong with your code.
What about the HSER definitions in your program, what does that code look like? Baud rate, etc.
Robert
![]()
HSERIN/OUT commands opened up a Serial Window when I executed them in ICD. At first glance I can't see what is wrong with your code.
What about the HSER definitions in your program, what does that code look like? Baud rate, etc.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
I believe that the ICD uses the hardware UART of the target PIC to communicate with MCSP. My guess is that you can't do both - run the ICD AND use the hardware UART under your program control. The complier is raising an error when it sees the HSERIN/OUT command when compiling for ICD use.
I suspect it's this line Hserout [Name[CharCount]]
How is this supposed to work? I.E. how are your variables/constants defined?
EDIT: Found the solution. Enclose all your array elements in parenthesis VS
square brackets.
For CharCount = 0 to NameCount
Hserout [Name(CharCount)]
Next CharCount
Hserout [10]
Hserout ["IP: ",DEC IP(0),".", DEC IP(1),".", DEC IP(2),".", DEC IP(3),10] 'Display IP Address
Works as expected.
Last edited by Bruce; - 30th July 2006 at 17:39.
Excellent. Thanks Bruce.Originally Posted by Bruce
I also found out that instead of
For CharCount = 0 to NameCount
Hserout [Name(CharCount)]
Next CharCount
it would compile with a single line of
Hserout [STR Name\Namecount]
which would achieve the same result although "Namecount" would have to be one higher than in the For/Next example.
What I dont understand is why the ICD compile gets upset with the square brackets when the ordinary complier accepts it.
I use the following two bits of code in the same program which follow the same style and both of those are fine.
For CharCount = 0 to NameCount
Read NameBase + CharCount,Char
Name[CharCount]=Char
Next CharCount
For CharCount = 0 to NameCount
LCDout Name[CharCount] ' Boot message.
Next CharCount
It would appear that it is only a problem with Hserout because that command requires square brackets as part of its syntax.
Just tried Hserin with the line Hserin [Name[Namecount]] and that compiles fine with [] or () around the array element.
Mighty strange, will drop David Barker an email to let him know of the inconsistency between the two compiles.
Keith
www.diyha.co.uk
www.kat5.tv
(old thread, but hey, information is information)
I wouldn't be surprised if it had to do with this:
https://www.picbasic.co.uk/forum/sho...?p=909#post909
When in doubt, rummage through Melanie's and Darryl's old posts. They've discussed all sorts of obscure stuff over the eons.
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bookmarks