|
|
View previous topic :: View next topic |
Author |
Message |
aldinlapinig
Joined: 16 Dec 2005 Posts: 22
|
printf with array problem...need help... |
Posted: Sat Jul 07, 2007 6:23 pm |
|
|
Hi all,
I used to get it right but now I can't... printf-ing an array out to the PIC's TX pin @ 115200 baud rate...
Code: | int COMMAND[18] = {0xC1,0x1E,0x00,0x0C,0xD1,0x00,0x07,0x00,0x01,0x00,0x03,0x00,0x01,0x44,0x00,0x56,0xD5};
printf(COMMAND); |
it will only give me the data: C1 and 1E... the 3rd with the rest of the data were not output-ed... what's going on? I'm using PCM v3.190 and I used its built-in tool, serial port monitor, to sniff the serial transaction and PIC16F628A (with 20MHz)... Thanx a lot for the help...
Best Regards,
-=alDin=- |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Jul 07, 2007 6:43 pm |
|
|
When printf sees that 0x00, it thinks it's the end of the string.
Use a for() loop that calls putc() instead. |
|
|
aldinlapinig
Joined: 16 Dec 2005 Posts: 22
|
THANK YOU SO MUCH... |
Posted: Sat Jul 07, 2007 7:01 pm |
|
|
IC...IC... Thank you very much for the help... didn't think 'bout that...
Cheers!!!
-=alDin=- |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|