Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F87K90 configuration
#1
Hello,
I'm new to this bootloader. I downloaded the latest free version from the forum and did the following changes:

Code:
settings.inc
processor    18F87K90
#define        OSCF            18432000
;#define    USE_UART1        1
#define      USE_UART2        1
#define    BAUDRATE         57600        

user_code.inc
bsf TRISG, 2
bcf TRISG, 1
bcf ANCON2, 2

devices_PIC18F.inc
    ifdef    __18F87K90
        #include    P18F87K90.inc
        #define    IS_PIC18F    1
        #define    VALID_DEV    1
        #define    MAX_FLASH    0x20000
        #define    RAM_START    0x0
        #define    RAM_SIZEB    3862
        #define    DEVICEID    353
        #define    HAS_UART2    1
        #define    HAS_EE        1
        #define    BIGEE        1
        #define    PAGESIZEW    64
        #define    ROWSIZEW    64
    endif

configuration bits
CONFIG1L    5D
CONFIG1H    08
CONFIG2L    7F
CONFIG2H    7F
CONFIG3L    01
CONFIG3H    8B
CONFIG4L    91
CONFIG5L    FF
CONFIG5H    C0
CONFIG6L    FF
CONFIG6H    E0
CONFIG7L    FF
CONFIG7H    40

Questions:

1) I don't know where to find the in the ds the parameters of the device. In detail: RAM_SIZEB, DEVICEID, PAGESIZEW and ROWSIZEW

2) Am I missing something about the configuration of the serial port?

3) I compiled and successfully programmed the MCU using the PicKit 3. But I cannot connect to the bootloader. In fact the GUI doesn't have the 87K90 model listed. I cannot use this bootloader?

Thanks
Mark
Reply
#2
One step forward, I had to explicitly copy the configuration bit into the code. It seems it doesn't read them from the IDE.

Now the baudrate is ok and the UART transmits fine (tested).

The problem is the RC2IF bit is not set when a char is received! Perhaps I'm missing something other during initialization?
Reply
#3
Well, the problem of the UART2 was related to a missing banksel instruction.

Now I can enter the bootloader and download the firmware using the GUI.
Of course it thinks I'm using an 87K22....

There are no errors but the application downloaded is not fully-functional and the bootloader is not executed anymore.

Is it due to some differences between 87K22 and 87K90?
The manual says for PIC18F I don't have to change anything in my application, is it true?

I will really appreciate an answer
Thanks in advance

I don't know why but it seems it works now.
I checked the "write config" and "don't write empty pages".

Honestly I don't understand how those flags did the trick.
Reply
#4
Hi,
This may be a problem with RAM banking with the current code. Let me check it out.

BR
Mikael
Reply
#5
Hi,
I just re-discovered this thread. Not sure why I answered like I did, you already found out and solved the banksel problem.
The "write config" and "don't write empty pages" options should not affect the application operation assuming you use the application config bits in the boot loader.

Do you still need to check "write config" and "don't write empty pages"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)