I'm using PIC24HJ with a software UART (can't use any hardware - due to spec). The fprintf sends hex sometimes correctly and sometimes it sends the hex and lots of zeros
289a0000000000... (and a lot more)
However using %lu prints the decimal correctly. Have you ever had similar problem? I'm using the FTDI chip as well (FT232RQ).
The CCS version is 4.126d. The UART baud rate is 57600 (tried increasing, no difference).
I think it could be something with the variable being global and declared in another file not main.
Thanks
I think I posted most of these points apart from a sample code. Since it's quite a big code at the moment it was hard to find that specific thing. Nevertheless, it took me all day chopping it down and checking bit by bit. I found the reason to be the RAM memory. One of my global variables storing data from GSM module was quite a big array 3kB. The compiler did not complain at all about that size but reducing it to 2.5kB seems to work.
Just to show you what exactly was going on with 3kB here's message from debug:
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