PIC4550 and PrintString Problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
floyd
Posts: 3
Joined: Thu Nov 22, 2007 9:34 am

PIC4550 and PrintString Problem

Post by floyd »

Hello,
i tried to make a simple Programm with the HP488 Board.
Bringing the LCD onBoard to work. With PIC16F88 this is no Problem, but with the PIC18F4550 i have a strange effect:

Using the PrintASCII or PrintNumber Makro, the Routine works fine. But if i use the PrintString-Makro i become some Crypt Character on the LCD, or nothing.
In my Demo-Program the Parameter in the PrintString-Makro is "Hello world".
I figure ot that the Char* String Pointer in the Routine PrintString give wrong characters (no "Hello world"... some different and changing Characters)?!?!?

***************************************************************************
void PrintString(char* String, char MSZ_String)
{
/*Macro_PrintString_Start*/
char idx = 0;
for (idx=0; idx<MSZ_String; idx++)
{
#ifdef _BOOSTC
if (String[idx] == 0)
{
break;
}
RawSend(String[idx], 0x10);
#endif
#ifdef HI_TECH_C
if (*String == 0)
{
break;
}
RawSend(*String, 0x10);
String++;
#endif
}
/*Macro_PrintString_End*/
}
*************************************************************************************
My Programm Version is Flowcode4 v4.2.3.58

I use the following Compiler Options:
D:\Programme\Matrix Multimedia\Flowcode V4\BoostC\boostc.pic16.flowcode.exe
-v -t PIC%p "%f.c"
D:\Programme\Matrix Multimedia\Flowcode V4\BoostC\boostlink.pic.exe
-ld "D:\Programme\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic16.lib flowcode.pic16.lib rand.pic16.lib float.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f"

The Problem is not in the Konfiguration-Bits. It must be in the in the Memory allocation for the String-Pointer!

I'm confused, because this is the only Makro with this Problems.... (in the moment ;-))

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC4550 and PrintString Problem

Post by Benj »

Hello

Ok that sounds strange,

Would it be possible to attach your flowcode program and the C file that is generated to the forums. I have a 18F4550 here so I will be able to test your program functionality. If you dont want to make your program public then you can PM me with the files.

floyd
Posts: 3
Joined: Thu Nov 22, 2007 9:34 am

Re: PIC4550 and PrintString Problem

Post by floyd »

Hi Benj,
thanks for your speed respons ;-)
But i solved the Problem yet...
It WAS in the Konfiguration! I have to Disable the "Extended CPU Enable" Feature!
Can you tell me the Reason? It only affect the PrintString-Makro....
If you like, you can try it... The Programm was simple... only a loop with PrintASCII - Wait - PrintString - Wait (the Problem was PrintString)

Best Regards
Floyd

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC4550 and PrintString Problem

Post by Benj »

Hi Floyd

Ah great glad you've got it sorted.

I know that the extended CPU option is aimed at arrays and string data but the BoostC compiler does not use the extended CPU options.

I have also come across Microchip technical articles that say you must have this setting disabled unless you are specifically using the extended CPU instructions so this makes sense.

I will give it a quick test here to see if I can replicate and then make a more definitive FAQ detailing the problem and the fix.

Thanks for letting me know :)

floyd
Posts: 3
Joined: Thu Nov 22, 2007 9:34 am

Re: PIC4550 and PrintString Problem

Post by floyd »

you are welcome :)
I'm happy too, that i solved this Problem, because i sitting here the half day for it....

Post Reply