Page 1 of 1

Pic18f46j50 problem

Posted: Sun Jan 12, 2014 11:29 am
by Desdewit
Hi Guys

Could this be a compiler error?
When I compile my rtcc test program to a pic18f25j50 the usb to serial sends the data to my pc as expected but when I compile to pic18f46j50 the data send to my pc is different and mixed around. :?

Re: Pic18f46j50 problem

Posted: Sun Jan 12, 2014 11:41 pm
by Kenrix2
Try loading the 18F46j50 with the hex file generated from your 18F25j50 project (since that one works) and see if it now works correctly. If it does work, then take a close look at the changes you made in your 18F46j50 project versus the 18F25j50 project.

Re: Pic18f46j50 problem

Posted: Tue Jan 14, 2014 5:24 am
by Desdewit
Hi Kenrix


Thanks for the reply.
I found that there is a clock speed difference even though both pics are using the same 8Mhz crystal & same rtcc crystal.
I also found that for some reason even when I remove the 8Mhz crystal the program keeps on running like nothing has changed.
Please have a look at the way I setup my config and rtcc timer to make sure there are no conflict.

Re: Pic18f46j50 problem

Posted: Tue Jan 14, 2014 8:20 pm
by Kenrix2
Thanks for posting your discovery Desdewit. It turns out that the configuration address in the .fcd files for this entire family needs to be edited. The configuration addresses can be found in table 6.1 in the device data sheet. Please find the line containing "ConfigAddress=" in the .fcd file for these chips and change the value according to the data sheet table. For example, in the PIC18F46j50 .fcd file the line should read ConfigAddress=0xFFF8 (save the change and restart Flowcode).

As for checking your rtcc timer, I have never worked with the rtcc and I also don't use 18F devices so I can't help with that.

Program run only when powered from usb

Posted: Sun Jan 19, 2014 11:16 am
by Desdewit
Hi Kenrix2

After changing the ConfigAddress I’ve noticed some other problems.
When my board is powered by usb only the first ASCII string send to LCD “Starting” display correct but the second ASCII string display as “PULLILE” instead of “running”
When powered from normal 12V power supply the program does not even start-up.
:x :x :x :x :x :x :x :x :x

Re: Pic18f46j50 problem

Posted: Sun Jan 19, 2014 8:36 pm
by Kenrix2
There are no configuration bits in your program, I wish I could help you in setting them but 18F devices are a mystery to me.

Re: Pic18f46j50 problem

Posted: Mon Jan 20, 2014 11:15 am
by Benj
Hello,

If you disable the assembler code you have to setup the RTCC then does the "Running" string appear correctly? Could be something to do with the RTCC code or the interrupts. String corruption on an 18F is normally associated with extended CPU config setting but your config has this setting disabled already.

Re: Pic18f46j50 problem

Posted: Mon Jan 20, 2014 5:57 pm
by Desdewit
Hi Benj

Sorry for the late reply.

I found that when I disable the RTCC Output Enable bit "bsf_rtccfg, RTCOE" the display is Ok.
The only other problem I found is that the program run +/- 200ms slower according to my test led on port D5 when I unplug the usb to serial cable.
Does not matter what Mhz crystal I put in the led speed stays the same.