Menu

FF5.0: CPU load calculation wrong after first word is compiled?

Holger
2014-03-02
2014-03-03
  • Holger

    Holger - 2014-03-02

    Hi, I've found some strange behaviour:

    Right after power the CPU load calculation on FF 5.0 is in the low %-age, and it remains there. If a LED is connected as load indicator it stays rather dark as well.

    However, once the first word is compiled into the flash both the LED and the CPU load calculation via "load" switch between dark/bright or low/high precentage with a cycle time for a minute or so. Once the system is reset the load remains in the low %-age again. To be more precise: the LED is bright for a minute, dark for a minute, bright... with a corrsponding CPU load polled via the "load" command, ex. 96 vs. 3.

    CPU: PIC24FJ64GA002

    Config:

    [...]
    ; Set to 1 for power save when CPU is idle
    .equ IDLE_MODE, 1

    ; Set to 1 for CPU load measurement
    .equ CPU_LOAD, 1

    ; CPU load indicator led definitions
    .equ CPU_LOAD_LED, 1 ; set to 0 to disable
    .equ CPU_LOAD_TRIS, TRISB
    .equ CPU_LOAD_PORT, LATB
    .equ CPU_LOAD_BIT, 15
    .equ CPU_LOAD_LED_POLARITY, 1 ; 0 = low on port turns on led, 1 = high on port turns on led

    ; Define the startup delay for turnkey words. Milliseconds
    .equ TURNKEY_DELAY, 2000 ; milliseconds

    [...]

    .equ DEBUG_INFO, 0
    .equ DEBUG_FLASH, 0
    .equ WRITE_METHOD, 2
    .equ WRITE_TIMEOUT, 500

    [...]
    .equ PFLASH, 0x2800 ; 8 Kbytes RAM 44 Kbyte flash

    ;;; Memory control defines
    .equ FLASH_ERASE, 0x4042 ; Erase one row (1024/1596 bytes)
    .equ FLASH_WRITE, 0x4001 ; Write one row (128/196 bytes)
    .equ FLASH_WRITE_SINGLE, 0x4003;Memory word program
    .equ PAIVT, 0x100
    .equ IBUFSIZEL, 0x0400
    .equ IBUFSIZEH, 0x0200
    .equ IBUFLEN1, 0x0040 ; Inner write loop
    .equ IBUFLEN2, 0x0008 ; Outer write loop
    .equ IBUFMASK, 0xfc00

    .equ MS_PR_VAL, (FCY/1000) ; Timer value for 1 ms ticks
    .equ BAUD_DIV1, (FCY/4/BAUDRATE1)-1 ; UART1 divisor
    .ifdecl BAUDRATE2
    .equ BAUD_DIV2, (FCY/4/BAUDRATE2)-1 ; UART2 divisor
    .endif
    .equ write_delay, 20 ; Flash write delay

    Greetings

    Holger

     

    Last edit: Holger 2014-03-02
  • Mikael Nordman

    Mikael Nordman - 2014-03-02

    Your config file looks old. That could be the problem
    Start again with the latest code and config files from GIT.

    At least it works on my pic24hj128.

    BR Mike

     
  • Holger

    Holger - 2014-03-02

    Ok, I will check tomorrow

    Greetings

    Holger

     
  • Holger

    Holger - 2014-03-03

    Rats - my bash shell script linked to the old forth version.

    FF5.0 works.

     

Log in to post a comment.