ds30 Loader free edition forums
PIC16F1947 (CCS Development tools) [abandoned] - 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: PIC16F1947 (CCS Development tools) [abandoned] (/showthread.php?tid=56)



PIC16F1947 (CCS Development tools) [abandoned] - BugVito - 2011-03-26

Hi all,
I've been looking at bootloaders for a few days, and landed on this ds30 loader which appears to be the most promising so far. Even though it appears perfect for my situation, I seem to need a bit of help on getting it to work.

Here's my scenario:
- Using CCS compiler for my applications
- Using CCSLoad with an ICD-U64 for programming
- Using Mplab for compiling this bootloader
- I do not have access to pull any pins high or low manually for using the bootloader, it should all be done in software. The ICSP is intended to only be used for programing the bootloader itself
- I have access to 2 serial ports, the main port (RC6-7) is through an FTDI

Here's where I'm at:
Despite the trivial configurations, I cannot get the bootloader to respond using the loader GUI.

When programing the configuration fuses (option in CCSLoad), I get errors:
Actual Expected
NOMCLR MCLR
PROTECT NOPROTECT

It programs fine when disabling the programing of the fuses, but either way, the bootloader doe not respond to the "Check for bl" despite trying different baudrates (matching in the bootloader and GUI).

As for hardware, as mentioned my serial port is through an FTDI, and I'm using the internal oscillator at 16MHz.

I've been using this hardware for a while, but never used any bootloaders.

All help would be very welcomed.

Thanks!

Using version from Jan 15th, PIC16F
Code:
#define        FOSC        16000000
#define        BAUDRATE    9600
#define        BLTIME        3000
#define        HELLOTRIES    3



RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-03-27

You probably need to program the "fuses" correctly. I have no previous experience of CCS or ICD-U64.

Post your configuration bits settings.
Do you configure intosc for 16MHz?



RE: PIC16F1947 (CCS Development tools) - BugVito - 2011-03-27

(2011-03-27, 18:58:14)Mikael Gustafsson Wrote: You probably need to program the "fuses" correctly. I have no previous experience of CCS or ICD-U64.

Post your configuration bits settings.
Do you configure intosc for 16MHz?

And I have no experience with MPlab Wink
I commented the configuration bits inside the settings.inc, and used the IDE for setting them, as I'm not familiar with this at all. Also, I have no clue how to specify the frequency (or option bits to select a frequency). In short, I'm a newb in your world.

See the attachment for the configuration bits.
.txt   mplab.TXT (Size: 2.53 KB / Downloads: 7)


RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-03-28

The configs look pretty good. You cold disable fail safe clock monitoring because you only have one clock source.
If you look in the data sheet you will see that the internal oscillator defaults to 500kHz on start-up. You will need to configure the osccon register to make it operate at 16MHz.

There is a template in ds30loader.asm for osccon configuration.


RE: PIC16F1947 (CCS Development tools) - BugVito - 2011-03-29

(2011-03-28, 22:02:02)Mikael Gustafsson Wrote: The configs look pretty good. You cold disable fail safe clock monitoring because you only have one clock source.
If you look in the data sheet you will see that the internal oscillator defaults to 500kHz on start-up. You will need to configure the osccon register to make it operate at 16MHz.

There is a template in ds30loader.asm for osccon configuration.

You're right with the default frequency, 500kHz.
For setting the oscillator to 16MHz with my current options:
Code:
banksel    OSCCON
movlw 0x79

I'm still at the same point though, where the bootloader is not found. The code compiles fine, and the programmer does program without errors with the programming fuse option on. after programming, I turn the device off, open up ds30 loader and set the proper options (proper port and 9600 baud for now, same as with the bootloader code), turn the device on and then (within 3 seconds) click on the find bl button. I keep getting the timeout.

I'm goign with plain settings meaning a low baud rate of 9600, and the cpu at 500khz to limit the changes to the project for the moment.

I'll start back from a fresh file and all, although I haven't made much changes. I am pretty confident that your response had the answer to my problem, but something else must be happening.


RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-03-31

Please post entire settings.inc.


RE: PIC16F1947 (CCS Development tools) - BugVito - 2011-04-02

(2011-03-31, 22:47:17)Mikael Gustafsson Wrote: Please post entire settings.inc.

Here you go:
.txt   settings.txt (Size: 4.19 KB / Downloads: 11)


RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-04-02

The settings look fine. Which uart do you use?

Because of the very low frequency the timeout calculation will be inaccurate, the actual time-out value might be less than 3 seconds.
Press download before reseting the device or press download very fast after resetting the device.


RE: PIC16F1947 (CCS Development tools) - BugVito - 2011-04-03

I had tried this before, and I also raised the wait time to 30 000ms just in case. Still no go.

As for the port, I'm using port 1.
A nice feature could be to have an easy way of specifying which one or either.
I had tried this before, and I also raised the wait time to 30 000ms just in case. Still no go.

As for the port, I'm using port 1.
A nice feature could be to have an easy way of specifying which one or either.


RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-04-04

Until recently I wasn't aware that there were PIC16 with more than 1 UART.
I have fixed this and it will be available in the next release which will come soon.

Do you have a application with a working UART?


RE: PIC16F1947 (CCS Development tools) - BugVito - 2011-04-05

(2011-04-04, 22:30:28)Mikael Gustafsson Wrote: Until recently I wasn't aware that there were PIC16 with more than 1 UART.
I have fixed this and it will be available in the next release which will come soon.

Sweet

(2011-04-04, 22:30:28)Mikael Gustafsson Wrote: Do you have a application with a working UART?

Meaning that I have tested both uarts with this board? Yes. Consider this board to be in production, I was hoping to offer the option of being firmware upgradable before offering this to friends and family.


RE: PIC16F1947 (CCS Development tools) - Mikael Gustavsson - 2011-04-05

Can you get it working at 500kHz?
Have you compared uart initializations?