I'm building a multifunctional board (just like Arduino UNO or so) with the PIC18F25K80 and I'm willing to program the Tiny Multi Bootloader+ on it.
When I first flashed the micro with the bootloader it woulnd't work, but then I changed the IRCF bits as follows and it worked (at least, the bootloader software recognized the micro):
What is on the bootloader: [...]
IntrareBootloader:
;skip TRIS to 0 C6
bsf OSCCON,IRCF0 ;int clock 16MHz
movlw ((1<<TXEN) | (1<<BRGH)) ;init serial port
movwf _TXSTA
;use only SPBRG (8 bit mode default) not using BAUDCON
movlw spbrg_value [...]
What I changed:
[...]
IntrareBootloader:
;skip TRIS to 0 C6
bsf OSCCON,IRCF0 ;int clock 16MHz
bsf OSCCON,IRCF1 ;int clock 16MHz
bsf OSCCON,IRCF2 ;int clock 16MHz
movlw ((1<<TXEN) | (1<<BRGH)) ;init serial port
movwf _TXSTA
;use only SPBRG (8 bit mode default) not using BAUDCON
movlw spbrg_value [...]
I did this in order to get the real 16MHz of clock frequency, according to the datasheet.
After this, the software provided with the bootloader started recognizing the micro at BR = 19200.
The problem is that I am trying to flash this piece of code into de micro:
And I get random values when I check the received data... (I use CoolTerm for MAC at BR=4800, according to the clock and BR configuration).
I use the XC8 Compiler, so I shouldn't need to add extra code to my program, but I am not sure if I'm missing something obvious, and I am breaking my heat off trying useless things that may never work.
So, I would really appreciate some help with that!
Thank you very much in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm building a multifunctional board (just like Arduino UNO or so) with the PIC18F25K80 and I'm willing to program the Tiny Multi Bootloader+ on it.
When I first flashed the micro with the bootloader it woulnd't work, but then I changed the IRCF bits as follows and it worked (at least, the bootloader software recognized the micro):
What is on the bootloader:
[...]
IntrareBootloader:
;skip TRIS to 0 C6
bsf OSCCON,IRCF0 ;int clock 16MHz
movlw ((1<<TXEN) | (1<<BRGH)) ;init serial port
movwf _TXSTA
;use only SPBRG (8 bit mode default) not using BAUDCON
movlw spbrg_value
[...]
What I changed:
[...]
IntrareBootloader:
;skip TRIS to 0 C6
bsf OSCCON,IRCF0 ;int clock 16MHz
bsf OSCCON,IRCF1 ;int clock 16MHz
bsf OSCCON,IRCF2 ;int clock 16MHz
movlw ((1<<TXEN) | (1<<BRGH)) ;init serial port
movwf _TXSTA
;use only SPBRG (8 bit mode default) not using BAUDCON
movlw spbrg_value
[...]
I did this in order to get the real 16MHz of clock frequency, according to the datasheet.
After this, the software provided with the bootloader started recognizing the micro at BR = 19200.
The problem is that I am trying to flash this piece of code into de micro:
include <xc.h>
include <p18f25k80.h>
void main(void) {
while(1){
while(!TXSTA1bits.TRMT);
TXREG1 = 'a';
}
}
And I get random values when I check the received data... (I use CoolTerm for MAC at BR=4800, according to the clock and BR configuration).
I use the XC8 Compiler, so I shouldn't need to add extra code to my program, but I am not sure if I'm missing something obvious, and I am breaking my heat off trying useless things that may never work.
So, I would really appreciate some help with that!
Thank you very much in advance.