Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed for 16F1827 bootloader [solved]
#1
Hello to all,

I have been trying in the last few days to get the ds30loader to work on the 16F1827, which to date I can not get to work, also this is my first attempt in using bootloaders.

In the uploaded zip file I have selected 16F1827 in the SETTINGS.INC file & 20mhz for FOSC as that is the clock frequency for my project, I also selected USE_TXENABLE to see if the ds30loader program was working as PORTB.B2 (TX pin) was not being set as output despite setting ANSELB in the USER_CODE.INC and adding clrf ANSELB.

Also using 20mhz resonator instead of cystal.

Also the USE_TXENABLE PORTB.B0 should be set as output but PORTB.B3
is the one that is set as output, I tried PORTB.B4 as well but PORTB.B3 keeps on being set as output.

The 16F1827 I am using is working as it works in my project with the onboard UART PORTB.B1(RX) & PORTB.B2(TX)

I use a USB - RS232 TTL cable with the TX connected to RX(PORTB.B1)
and RX connected to TX(PORTB.B2)

Using the GUI loader I get no response from the bootloader, on the 1827
there is nothing on the TX pin of the 1827 PORTB.B2 to indicate data being sent out from the PIC, which seems to be set as input.

MPLAB used is V8.90 and I use MikroC Pro as my compiler.

Any help to steer me in the right direction would be appreciated

regards Andrew


Attached Files Thumbnail(s)
   

.zip   firmware PIC12F PIC16F.zip (Size: 64.63 KB / Downloads: 26)
Reply
#2
Hi,
You need to setup the configuration bits. They are all commented out.
Reply
#3
Hello Mikael,

I got the bootloader to work last night, I had to add the following code into user_code.inc

Code:
ifdef    ANSELB

                ;error Do you need to configura uart pins to be digital? If not, remove this line

                banksel  ANSELB
                clrf     ANSELB
                banksel  TRISB
                movlw    B'11110011'                 ;  hardware-UART Tx/Rx direction
                movwf    TRISB
                banksel  PORTB
                movlw    B'11111111'
                movwf    PORTB
            endif


now the bootloader works

I also set the config bits in settings.inc for my setup

regards Andrew
Reply
#4
Great, thanks for letting us know.
Reply
#5
Hi Andrew,
Can you share your complete modified version of the bootloader folder with us? I am trying to make it work with PIC16F1847 with an external 20 MHz resonator, and having the similar problem.

Thanks,
Raj
(2013-03-19, 00:19:48)andcvi Wrote: Hello Mikael,

I got the bootloader to work last night, I had to add the following code into user_code.inc

Code:
ifdef    ANSELB

                ;error Do you need to configura uart pins to be digital? If not, remove this line

                banksel  ANSELB
                clrf     ANSELB
                banksel  TRISB
                movlw    B'11110011'                 ;  hardware-UART Tx/Rx direction
                movwf    TRISB
                banksel  PORTB
                movlw    B'11111111'
                movwf    PORTB
            endif


now the bootloader works

I also set the config bits in settings.inc for my setup

regards Andrew

I was able to make the bootloader work for PIC16F1827 with the modifications suggested by Andrew. However, when I tried to do the same with PIC16F1847, the GUI returns the following error.

Searching for bl .
Found PIC16F1513 fw ver. 1.0.2
Wrong pic detected(499)/selected(468), aborting

Any suggestion, why the GUI is detecting a wrong PIC.

Thanks,
Raj

sds
(2013-05-15, 05:11:08)rajbex Wrote: Hi Andrew,
Can you share your complete modified version of the bootloader folder with us? I am trying to make it work with PIC16F1847 with an external 20 MHz resonator, and having the similar problem.

Thanks,
Raj
(2013-03-19, 00:19:48)andcvi Wrote: Hello Mikael,

I got the bootloader to work last night, I had to add the following code into user_code.inc

Code:
ifdef    ANSELB

                ;error Do you need to configura uart pins to be digital? If not, remove this line

                banksel  ANSELB
                clrf     ANSELB
                banksel  TRISB
                movlw    B'11110011'                 ;  hardware-UART Tx/Rx direction
                movwf    TRISB
                banksel  PORTB
                movlw    B'11111111'
                movwf    PORTB
            endif


now the bootloader works

I also set the config bits in settings.inc for my setup

regards Andrew
Reply
#6
Hi,

I have been trying for the better part of two days. I tried with the zip file, and then I tried using the template provided.

However, the problem is that the DS30 Loader is not even picking up the bootloader . . .

I have extensively tested the UART with the actual target code for my board and it works, so there is nothing wrong with the device, or the board. It just seems that the PIC is not sending the "I am here" and then later "ready to bootload" signal once the bootloader code is installed. I have also tested the PCB with the bootloader installed using a terminal app to see if the codes coming from the PIC can be seen but nothing.

So, the check would be if the UART is set up correctly and from what I can tell, the answer is yes.

Any help would be appreciated.

I can provide the project if needed, but it looks like adding files to this thread is blocked

Thankyou
Reply
#7
Hi,
Please post your complete boot loader project and I will have a look.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)