ds30 Loader free edition forums
Communication problem [solved] - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7)
+--- Thread: Communication problem [solved] (/showthread.php?tid=506)



Communication problem [solved] - egoltzman - 2012-07-20

Hello,
I load the BL to my target PIC16F1937 (I change it from LF to F).

Before I try that I check that my application is communicate well over the UART so I'm sure my UART HW is working.

After loading the BL I can't see the BL from the GUI, it give me this message:
Searching for bl . . . . . . . . . . . . . . . . . . . . timed out

What could be wrong? How can I debug it?

Thanks,

Eyal


RE: Communication problem - Mikael Gustavsson - 2012-07-21

Hi
Please post the modified settings.inc file (or its content).

BR
Mikael


RE: Communication problem - egoltzman - 2012-07-21

(2012-07-21, 21:49:03)Mikael Gustafsson Wrote: Hi
Please post the modified settings.inc file (or its content).

BR
Mikael
Hello Mikael,

Please see the attached setting.inc and user_code.inc.

I'm using internal 8MHz clock.

Thanks,

Eyal



RE: Communication problem - Mikael Gustavsson - 2012-07-24

The FOSC define in settings.inc is set to 500000. It should be set to 8000000 if you are using a 8MHz clock.


RE: Communication problem - egoltzman - 2012-07-24

(2012-07-24, 00:05:16)Mikael Gustafsson Wrote: The FOSC define in settings.inc is set to 500000. It should be set to 8000000 if you are using a 8MHz clock.
It was set in the beginning to 8000000 but I did not succeeded to get it worked so I tried to send a constant char on the tx line in a loop and analyze it with a logic analyzer, I saw that I get the output in around 600 boud, only when I put the 500000 I saw significant output in 9600 on the logic but even then after remove the tx loop I did not succeed to connect.

Thanks,

Eyal



RE: Communication problem - Mikael Gustavsson - 2012-07-25

You configure the intosc to 500kHz. Take a look at the OSCCON register in the datasheet again.
Code:
            bsf        OSCCON, IRCF0    ;bank 1
            bsf        OSCCON, IRCF1
            bsf        OSCCON, IRCF2
9600 is not a valid baud rate with 500kHz oscillator and your current UART configuration. The error is 8.5%.


RE: Communication problem - egoltzman - 2012-07-25

(2012-07-25, 20:35:20)Mikael Gustafsson Wrote: You configure the intosc to 500kHz. Take a look at the OSCCON register in the datasheet again.
Code:
            bsf        OSCCON, IRCF0    ;bank 1
            bsf        OSCCON, IRCF1
            bsf        OSCCON, IRCF2
9600 is not a valid baud rate with 500kHz oscillator and your current UART configuration. The error is 8.5%.
Yes!! This was it!! Thanks!

I thought I set the OSCCON to 8M but I was shifted 1 bit to the right...

It is working now!!

Another question:

I have another PIC24F controller that control the PIC16F and they are connected serially (RS232), I want to load the PIC16F application from the PIC24F (with the BL on the PIC16F), how can I do it? Where can I find the writing protocol so I can program it to the PIC24F? Or maybe there is another way?

Thanks,

Eyal



RE: Communication problem - Mikael Gustavsson - 2012-07-29

Great!

The protocol is not available for the free edition. For commercial applications:
http://www.ds30loader.com/

BR
Mikael