View previous topic :: View next topic |
Author |
Message |
teekaytk
Joined: 14 Jan 2005 Posts: 28
|
printf hangs |
Posted: Mon May 29, 2006 5:44 am |
|
|
hi i am using 18LF8720 in 3.3v system. printf command seems to make it hang during strings longer than 10 characters. but putc always works.
has any one found this problem before. is this a bug? or is it just me!
please help |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon May 29, 2006 6:10 am |
|
|
As far as I know this is not a known bug. Which compiler version are you using?
Can you post a small but compilable program showing your problem? |
|
|
teekaytk
Joined: 14 Jan 2005 Posts: 28
|
|
Posted: Mon May 29, 2006 6:24 am |
|
|
ver is 3.230
Code: | #include <18F8720.h>
#device *=16//,icd=true
#use delay(clock=16000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
#fuses NOWDT,WDT128, HS, NOPROTECT, NOOSCSEN, NOBROWNOUT, BORV25, NOPUT, NOCPD, STVREN, NODEBUG, NOLVP, NOWRT, NOCPB, NOEBTR, NOWRTD, NOWRTC, NOWRTB |
Code: |
void main (){
printf("initialize done")
while(1){}
}
|
code that works
Code: | void main (){
while(1){putc(oxAA)}
} |
|
|
|
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Mon May 29, 2006 6:31 am |
|
|
Maybe you can try
Code: | printf("%S","TRY THIS"); |
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon May 29, 2006 7:03 am |
|
|
teekaytk wrote: | code that works
Code: | void main (){
while(1){putc(oxAA)}
} |
| You are cheating, I do understand your intentions but both your example codes contain compiler errors. From the given example code I don't understand why it isn't working but as this is not your real program code the error might be somewhere else.
Code: | #device *=16//,icd=true | For the PIC18 series this line can be omitted, it will always use 16-bit pointers. |
|
|
|