Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Communication problem [solved]
#1
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
Reply
#2
Hi
Please post the modified settings.inc file (or its content).

BR
Mikael
Reply
#3
(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


Attached Files
.zip   src.zip (Size: 2.51 KB / Downloads: 14)
Reply
#4
The FOSC define in settings.inc is set to 500000. It should be set to 8000000 if you are using a 8MHz clock.
Reply
#5
(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
Reply
#6
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%.
Reply
#7
(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
Reply
#8
Great!

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

BR
Mikael
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)