News:

Let's find out together what makes a PIC Tick!

Main Menu

16F15223 Configuration issue

Started by okmn, May 15, 2024, 03:57 PM

Previous topic - Next topic

tumbleweed

In Osc_Init_32MHz(), shouldn't the setting for OSCEN be
  OSCEN = $40        'HFINTOSC is explicitly enabled, operating as specified by the OSCFRQ register


okmn

nothing change  with  OSCEN = $40

Proc Osc_Init_32MHz()
    OSCEN = $40'00
    OSCFRQ = $05                                ' FRQ 32MHz
    OSCTUNE = $00
EndProc

it is alrady one led blinking  (1s)   other led  no blink (500ms)
problem looks timer0 can not setup.

It can't go to Timer0's interrupt at all, so even if it goes there once, it will turn on the led in the interrupt and turn it off the next time it goes... but it doesn't even turn it on.

RGV250

Hi,
Looking on phone so not easy but I think you should put interrupt code above and a jump over it. As you have it in the middle of everything.
Bob

RGV250

I think you need something like this but havent got Positron on tablet.

Goto OverInterrupt


ISR_Handler:
Context Save
 If PIR0bits_TMR0IF = 1 Then   
    PIR0bits_TMR0IF = 0
    TMR0H = $F6
    TMR0L = $3C
    Inc Ten_MilliSeconds
    If Ten_MilliSeconds = 50 Then
        Ten_MilliSeconds = 0
        Toggle Blink_Led_1'Every 500ms blink
    EndIf           
 EndIf
Context Restore


OverInterrupt:

On_Hardware_Interrupt GoTo ISR_Handler
Main:
Main:
Setup()                                    ' Setup the program and peripherals
LATA = 0
LATC = 0
ANSELA = 0
ANSELC = 0
TRISA = 0
TRISC = 0
Symbol Blink_Led_1 = LATA.2
Symbol Blink_Led_2 = LATC.0
Dim Ten_MilliSeconds As Byte = 0
Dim Temporary As Word = 0

Pepe

I don't think the problem is in the source because the same program from 16f15223 works on 18f26k40 as seen in the Proteus demo.

okmn

#25
yes  it is works also for 16F15323  too.(i tested)

it has something! for 16F15223

RGV250

#26
Hi,
Have you compared the PPI files / datasheets of the 2 to see if there are any differences?

I have just had a quick look and 16F15223 is not supported, If you look in the compiler where the Device =  line is. Device = 16F15323 text goes blue in the declare line but the 15223 does not.

Bob

tnencon

The compiler supports PIC16F15223. Otherwise, the compilation process would not occur.

RGV250

#28
Hi,
Interesting, what version are you using as it does not on mine. 4.0.3.8

Bob

Stephen Moss

@RGV250 the 16F12223 is supported in 4.0.4.2, so if want it you would have to pay to update to the latest upgrade as that came in at 4.0.4.0, which unless I am missing a file from my collection appear to be the next version released after 4.0.3.8.

RGV250

Hi Stephen,
I never use 16 series, I was just trying to help the tread which due to the issue appears to be a PPI / configuration issue.
Thanks for letting me know though.

Bob

top204

#31
Make sure you are actually using version 4.0.4.2 of the Positron8 compiler, because this corrected the config fuses for the newer enhanced 14-bit core devices added in the upgrade. Press the F2 button in the IDE and look at the top comments in the assembler file and it will tell you the compiler's version and who it is registered too.

I have attached a demonstration program of the PIC16F15223 operating a Timer0 overflow interrupt using a more structured approach and using a Timer0 library that has the commonly used Timer0 SFRs in it, and meta-macros to make them simple to use, and easier to follow in the main program listing. It also has a mechanism for creating the Timer0 value for a specific interrupt time interval.

The demo code listing is below, but it also uses the "Timer0_16Fxx223.inc" file that is within the attached zip file. I do not have a PIC16F15223 device, but according to the datasheet it should work OK, and I have used the same mechanisms and meta-macros on many other devices, but with modified SFRs and bits to suit the device used:

'
'   /\\\\\\\\\
'  /\\\///////\\\
'  \/\\\     \/\\\                                                 /\\\          /\\\
'   \/\\\\\\\\\\\/        /\\\\\     /\\\\\\\\\\     /\\\\\\\\   /\\\\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\
'    \/\\\//////\\\      /\\\///\\\  \/\\\//////    /\\\/////\\\ \////\\\////  \////\\\////  \////////\\\
'     \/\\\    \//\\\    /\\\  \//\\\ \/\\\\\\\\\\  /\\\\\\\\\\\     \/\\\         \/\\\        /\\\\\\\\\\
'      \/\\\     \//\\\  \//\\\  /\\\  \////////\\\ \//\\///////      \/\\\ /\\     \/\\\ /\\   /\\\/////\\\
'       \/\\\      \//\\\  \///\\\\\/    /\\\\\\\\\\  \//\\\\\\\\\\    \//\\\\\      \//\\\\\   \//\\\\\\\\/\\
'        \///        \///     \/////     \//////////    \//////////      \/////        \/////     \////////\//
'                                  Let's find out together what makes a PIC Tick!
'
' A code listing template for a PIC16F15223 device operating at 32MHz with the internal oscillator.
' The demonstration operates a Timer0 overflow interrupt to flash an LED.
'
' Written by Les Johnson for the Positron8 BASIC compiler, version 4.0.4.2 onwards.
'
    Device = 16F15223                               ' Tell the compiler what device to compile for
    Declare Xtal = 32                               ' Tell the compiler what frequency the device is operating at (in MHz)
    On_Hardware_Interrupt GoTo ISR_Handler          ' Point to the interrupt handler routine

    Include "Timer0_16Fxx223.inc"                   ' Load the Timer0 meta-macros library for a PIC1615F223 device
'
' Create global variables, constants and alias' here
'
    $define LED1_Pin PORTC.0                        ' The pin LED1 is connected too (flashed in the main rogram loop)
    $define LED2_Pin PORTA.2                        ' The pin LED2 is connected too (flashed in the Timer0 interrupt)

'--------------------------------------------------------------------------------------------------
' The main program starts here
' Flash an LED in the program's loop and another LED within the interrupt handler
'
Main:
    Setup()                                         ' Setup the program and peripherals

    Do                                              ' Create a loop
        Toggle LED1_Pin                             ' Toggle LED1
        DelayMS 500                                 ' Delay for a half a second
    Loop                                            ' Do it forever

'--------------------------------------------------------------------------------------------------
' Setup the program and peripherals
' Input     : None
' Output    : None
' Notes     : None
'
Proc Setup()
    Osc_Init_32MHz()                                ' Setup the PIC16F15223 to operate with its internal oscillator at 32MHz

    PinLow LED1_Pin                                 ' Set the LED1 pin as an output low
    PinLow LED2_Pin                                 ' Set the LED1 pin as an output low
    Timer0_Init()                                   ' Initialise Timer0
    Periph_IntEnable()                              ' Enable peripheral interrupts (just in case this devices needs it for Timer0)
    Global_IntEnable()                              ' Enable global interrupts
EndProc

'--------------------------------------------------------------------------
' Initialise Timer0
' Input     : None
' Output    : None
' Notes     : Timer0 configured for 16-bit
'
Proc Timer0_Init()
    wTimer0_SFR = Timer0_cValue                     ' Load TMR0L\H with the interrupt duration
    Timer0_FlagClear()                              ' Clear Timer0 Interrupt flag
    T0CON0 = %00010000                              ' Prescaler set for 1:1, Timer0 disabled, Timer0 set for 16-bit
    T0CON1 = %01010010                              ' Timer0 Mode set for FOSC/4, Postscaler set for 1:1, Timer0 not synchronised
    Timer0_Prescaler(Timer0_cPrescalerValue)        ' Set the prescaler for the value used in the Timer0_cPrescalerValue $define
    Timer0_Enable()                                 ' Start Timer0
EndProc

'--------------------------------------------------------------------------------------------------
' Setup the PIC16F15223 to operate with its internal oscillator at 32MHz
' Input     : None
' Output    : None
' Notes     : None
'
Proc Osc_Init_32MHz()
    OSCEN = %00000000
    OSCFRQ = %00000101                              ' FRQ is 32MHz
    OSCTUNE = %00000000
EndProc

'--------------------------------------------------------------------------------------------------
' Interrupt Handler routine
' Input     : None
' Output    : None
' Notes     : Interrupts on a Timer0 overflow
'
ISR_Handler:
    Context Save                                    ' Save compiler system variables and important SFRs used, before performing the interrupt code

    If Timer0_Flag = 1 Then                         ' Was it a Timer0 that triggered the interrupt?
        Toggle LED2_Pin                             ' Yes. So Toggle LED2 pin
        wTimer0_SFR = Timer0_cValue                 ' Load TMR0L\H with the interrupt duration
        Timer0_FlagClear()                          ' Clear the Timer0 Interrupt flag
    EndIf

    Context Restore                                 ' Restore any variables and SFRs used, then exit the interrupt

'--------------------------------------------------------------------------------------------------
' Setup the config fuses for the internal 32MHz oscillator
'
    Config1 FEXTOSC_OFF,_                           ' External Oscillator not enabled
            RSTOSC_HFINTOSC_32MHZ,_                 ' HFINTOSC (32 MHz)
            CLKOUTEN_OFF,_                          ' CLKOUT function is disabled. I/O function on RA4
            VDDAR_HI                                ' VDD Internal analog systems are calibrated for operation between VDD = 2.3V - 5.5V

    Config2 MCLRE_EXTMCLR,_                         ' If LVP = 0, MCLR pin is MCLR. If LVP = 1. RA3 pin function is MCLR
            PWRTS_PWRT_OFF,_                        ' PWRT is disabled
            WDTE_OFF,_                              ' WDT disabled. SEN is ignored
            BOREN_ON,_                              ' Brown-out Reset Enabled. SBOREN bit is ignored
            BORV_LO,_                               ' Brown-out Reset Voltage (VBOR) set to 1.9V
            PPS1WAY_OFF,_                           ' The PPSLOCKED bit can be set and cleared as needed
            STVREN_ON                               ' Stack Overflow or Underflow will cause a reset

    Config4 BBSIZE_BB512,_                          ' 512 words boot block size
            BBEN_OFF,_                              ' Boot Block is disabled
            SAFEN_OFF,_                             ' SAF is disabled
            WRTAPP_OFF,_                            ' Application Block is not write-protected
            WRTB_OFF,_                              ' Boot Block is not write-protected
            WRTC_OFF,_                              ' Configuration Registers are not write-protected
            WRTSAF_OFF,_                            ' Storage Area Flash is not write-protected
            LVP_OFF                                 ' High Voltage on MCLR/Vpp must be used for programming

    Config5 CP_OFF                                  ' User Program Flash Memory code protection is disabled

As you can see, it is more structured and easier to read and understand.

With a timer interrupt, always clear its interrupt flag at the end of the interrupt's code, otherwise, the timer's flag could set again before it is finished. Remember, a timer does not automatically stop while its interrupt is called and being used. The same for the timer's re-loading value (if there is one). This should be loaded at the end of the interrupt's code, just before its flag is cleared.

Viewing the config fuses for the above program (as in the image below), they are correct, and that is what the update's correction were for. The attached file is named: "16F15223_Timer0_Interrupt.zip", and make sure the "Timer0_16Fxx223.inc" file stays in the same folder as the program listing including it:

Config fuses screenshot.jpg

Pepe

#32
Table 9-5. Core Registers
Addresses in BANKx Core Registers
x00h or x80h INDF0
x01h or x81h INDF1
x02h or x82h PCL
x03h or x83h STATUS
x04h or x84h FSR0L
x05h or x85h FSR0H
x06h or x86h FSR1L
x07h or x87h FSR1H
x08h or x88h BSR
x09h or x89h WREG
x0Ah or x8Ah PCLATH
x0Bh or x8Bh INTCON

add this in your program
PIR0bits_TMR0IF = 0

Asm
Movlb 0x0
EndAsm

INTCONbits_PEIE = 1 'Peripheral Interrupt enabled
INTCONbits_GIE = 1  'Global Interrupt enabled
PIE0bits_TMR0IE = 1 'TMR0 Interrupt enabled
T0CON0Bits_T0EN = 1 'Timer0 Enabled


because we need to return to bank zero to assign intcon

this is bad
F1_000060 equ $ ; in [LEDS.BAS] PIR0.5 = 0
    movlb 0x0E
    bcf PIR0,5
F1_000065 equ $ ; in [LEDS.BAS] INTCON.6 = 1
    bsf INTCON,6
F1_000066 equ $ ; in [LEDS.BAS] INTCON.7 = 1
    bsf INTCON,7
F1_000067 equ $ ; in [LEDS.BAS] PIE0.5 = 1
    bsf PIE0,5
F1_000068 equ $ ; in [LEDS.BAS] T0CON0.7 = 1

this is correct
F1_000060 equ $ ; in [LEDS.BAS] PIR0.5 = 0
    movlb 0x0E
    bcf PIR0,5


    movlb 0x0


F1_000065 equ $ ; in [LEDS.BAS] INTCON.6 = 1
    bsf INTCON,6
F1_000066 equ $ ; in [LEDS.BAS] INTCON.7 = 1
    bsf INTCON,7
F1_000067 equ $ ; in [LEDS.BAS] PIE0.5 = 1

    movlb 0x0E

    bsf PIE0,5
F1_000068 equ $ ; in [LEDS.BAS] T0CON0.7 = 1

tumbleweed

#33
Quotebecause we need to return to bank zero to assign intcon
INTCON is part of the Core Registers, so it's accessible with any bank select setting.
Changing banks isn't necessary.

From the datasheet:
QuoteThe core registers contain the registers that directly affect the basic operation. The core registers occupy the first 12 addresses of every data memory bank

top204

#34
As tumbleweed stated, certain SFRs are in bankless RAM and the compiler is well aware of this so does not add unrequired RAM bank mnemonics.

For example, the RAM bank setting function for enhanced 14-bit core devices in the compiler uses the code below for placing the RAM bank mnemonic, after it has checked other things as well:

if(((Bytein_Address >> 7) != Global_Previous_RAM_Bank) && ((Bytein_Address & 0x7F) > 0x0B))
    {
        movlb(Bytein_Address >> 7);
        Global_Previous_RAM_Bank = Bytein_Address >> 7;
    }

See that it first checks whether the previous RAM bank setting is not the same as the one being looked at, and that the variable or SFR it is examining is not in bankless RAM, before issuing the movlb mnemonic and setting its internal variable for the current RAM bank it is in.

More optimised RAM bank manipulation has been with the 8-bit compiler since I started writing it all of those years ago, and is one of the things that makes the assembler code so optimised, and not just full of unrequired bank setting mnemonics on any device type, as some other compilers do.

okmn

#35
Quote from: top204 on Jun 03, 2024, 01:04 PMMake sure you are actually using version 4.0.4.2 of the Positron8 compiler, because this corrected the config fuses for the newer enhanced 14-bit core devices added in the upgrade. Press the F2 button in the IDE and look at the top comments in the assembler file and it will tell you the compiler's version and who it is registered too.

I have attached a demonstration program of the PIC16F15223 operating a Timer0 overflow interrupt using a more structured approach and using a Timer0 library that has the commonly used Timer0 SFRs in it, and meta-macros to make them simple to use, and easier to follow in the main program listing. It also has a mechanism for creating the Timer0 value for a specific interrupt time interval.

The demo code listing is below, but it also uses the "Timer0_16Fxx223.inc" file that is within the attached zip file. I do not have a PIC16F15223 device, but according to the datasheet it should work OK, and I have used the same mechanisms and meta-macros on many other devices, but with modified SFRs and bits to suit the device used:

'
'  /\\\\\\\\\
'  /\\\///////\\\
'  \/\\\    \/\\\                                                /\\\          /\\\
'  \/\\\\\\\\\\\/        /\\\\\    /\\\\\\\\\\    /\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\
'    \/\\\//////\\\      /\\\///\\\  \/\\\//////    /\\\/////\\\ \////\\\////  \////\\\////  \////////\\\
'    \/\\\    \//\\\    /\\\  \//\\\ \/\\\\\\\\\\  /\\\\\\\\\\\    \/\\\        \/\\\        /\\\\\\\\\\
'      \/\\\    \//\\\  \//\\\  /\\\  \////////\\\ \//\\///////      \/\\\ /\\    \/\\\ /\\  /\\\/////\\\
'      \/\\\      \//\\\  \///\\\\\/    /\\\\\\\\\\  \//\\\\\\\\\\    \//\\\\\      \//\\\\\  \//\\\\\\\\/\\
'        \///        \///    \/////    \//////////    \//////////      \/////        \/////    \////////\//
'                                  Let's find out together what makes a PIC Tick!
'
' A code listing template for a PIC16F15223 device operating at 32MHz with the internal oscillator.
' The demonstration operates a Timer0 overflow interrupt to flash an LED.
'
' Written by Les Johnson for the Positron8 BASIC compiler, version 4.0.4.2 onwards.
'
    Device = 16F15223                              ' Tell the compiler what device to compile for
    Declare Xtal = 32                              ' Tell the compiler what frequency the device is operating at (in MHz)
    On_Hardware_Interrupt GoTo ISR_Handler          ' Point to the interrupt handler routine

    Include "Timer0_16Fxx223.inc"                  ' Load the Timer0 meta-macros library for a PIC1615F223 device
'
' Create global variables, constants and alias' here
'
    $define LED1_Pin PORTC.0                        ' The pin LED1 is connected too (flashed in the main rogram loop)
    $define LED2_Pin PORTA.2                        ' The pin LED2 is connected too (flashed in the Timer0 interrupt)

'--------------------------------------------------------------------------------------------------
' The main program starts here
' Flash an LED in the program's loop and another LED within the interrupt handler
'
Main:
    Setup()                                        ' Setup the program and peripherals

    Do                                              ' Create a loop
        Toggle LED1_Pin                            ' Toggle LED1
        DelayMS 500                                ' Delay for a half a second
    Loop                                            ' Do it forever

'--------------------------------------------------------------------------------------------------
' Setup the program and peripherals
' Input    : None
' Output    : None
' Notes    : None
'
Proc Setup()
    Osc_Init_32MHz()                                ' Setup the PIC16F15223 to operate with its internal oscillator at 32MHz

    PinLow LED1_Pin                                ' Set the LED1 pin as an output low
    PinLow LED2_Pin                                ' Set the LED1 pin as an output low
    Timer0_Init()                                  ' Initialise Timer0
    Periph_IntEnable()                              ' Enable peripheral interrupts (just in case this devices needs it for Timer0)
    Global_IntEnable()                              ' Enable global interrupts
EndProc

'--------------------------------------------------------------------------
' Initialise Timer0
' Input    : None
' Output    : None
' Notes    : Timer0 configured for 16-bit
'
Proc Timer0_Init()
    wTimer0_SFR = Timer0_cValue                    ' Load TMR0L\H with the interrupt duration
    Timer0_FlagClear()                              ' Clear Timer0 Interrupt flag
    T0CON0 = %00010000                              ' Prescaler set for 1:1, Timer0 disabled, Timer0 set for 16-bit
    T0CON1 = %01010010                              ' Timer0 Mode set for FOSC/4, Postscaler set for 1:1, Timer0 not synchronised
    Timer0_Prescaler(Timer0_cPrescalerValue)        ' Set the prescaler for the value used in the Timer0_cPrescalerValue $define
    Timer0_Enable()                                ' Start Timer0
EndProc

'--------------------------------------------------------------------------------------------------
' Setup the PIC16F15223 to operate with its internal oscillator at 32MHz
' Input    : None
' Output    : None
' Notes    : None
'
Proc Osc_Init_32MHz()
    OSCEN = %00000000
    OSCFRQ = %00000101                              ' FRQ is 32MHz
    OSCTUNE = %00000000
EndProc

'--------------------------------------------------------------------------------------------------
' Interrupt Handler routine
' Input    : None
' Output    : None
' Notes    : Interrupts on a Timer0 overflow
'
ISR_Handler:
    Context Save                                    ' Save compiler system variables and important SFRs used, before performing the interrupt code

    If Timer0_Flag = 1 Then                        ' Was it a Timer0 that triggered the interrupt?
        Toggle LED2_Pin                            ' Yes. So Toggle LED2 pin
        wTimer0_SFR = Timer0_cValue                ' Load TMR0L\H with the interrupt duration
        Timer0_FlagClear()                          ' Clear the Timer0 Interrupt flag
    EndIf

    Context Restore                                ' Restore any variables and SFRs used, then exit the interrupt

'--------------------------------------------------------------------------------------------------
' Setup the config fuses for the internal 32MHz oscillator
'
    Config1 FEXTOSC_OFF,_                          ' External Oscillator not enabled
            RSTOSC_HFINTOSC_32MHZ,_                ' HFINTOSC (32 MHz)
            CLKOUTEN_OFF,_                          ' CLKOUT function is disabled. I/O function on RA4
            VDDAR_HI                                ' VDD Internal analog systems are calibrated for operation between VDD = 2.3V - 5.5V

    Config2 MCLRE_EXTMCLR,_                        ' If LVP = 0, MCLR pin is MCLR. If LVP = 1. RA3 pin function is MCLR
            PWRTS_PWRT_OFF,_                        ' PWRT is disabled
            WDTE_OFF,_                              ' WDT disabled. SEN is ignored
            BOREN_ON,_                              ' Brown-out Reset Enabled. SBOREN bit is ignored
            BORV_LO,_                              ' Brown-out Reset Voltage (VBOR) set to 1.9V
            PPS1WAY_OFF,_                          ' The PPSLOCKED bit can be set and cleared as needed
            STVREN_ON                              ' Stack Overflow or Underflow will cause a reset

    Config4 BBSIZE_BB512,_                          ' 512 words boot block size
            BBEN_OFF,_                              ' Boot Block is disabled
            SAFEN_OFF,_                            ' SAF is disabled
            WRTAPP_OFF,_                            ' Application Block is not write-protected
            WRTB_OFF,_                              ' Boot Block is not write-protected
            WRTC_OFF,_                              ' Configuration Registers are not write-protected
            WRTSAF_OFF,_                            ' Storage Area Flash is not write-protected
            LVP_OFF                                ' High Voltage on MCLR/Vpp must be used for programming

    Config5 CP_OFF                                  ' User Program Flash Memory code protection is disabled

As you can see, it is more structured and easier to read and understand.

With a timer interrupt, always clear its interrupt flag at the end of the interrupt's code, otherwise, the timer's flag could set again before it is finished. Remember, a timer does not automatically stop while its interrupt is called and being used. The same for the timer's re-loading value (if there is one). This should be loaded at the end of the interrupt's code, just before its flag is cleared.

Viewing the config fuses for the above program (as in the image below), they are correct, and that is what the update's correction were for. The attached file is named: "16F15223_Timer0_Interrupt.zip", and make sure the "Timer0_16Fxx223.inc" file stays in the same folder as the program listing including it:

Config fuses screenshot.jpg

Thank you Les,

i tried it  but only LED1_Pin (RC0) is blinking (i also checked by oscilloscope.)

in this lines

Main:
    Setup()                                        ' Setup the program and peripherals

    Do                                              ' Create a loop
        Toggle LED1_Pin                            ' Toggle LED1 pin10
        DelayMS 100                                ' Delay for a half a second
    Loop                         

top204

Make sure you can actually use PORTA.2 for an output on this device. It may need an SFR's bit changing that has not been noticed in the datasheet.

okmn

#37
yes i am sure.
Pin 11 (RA2) logic status no change
it's always 0 (npn transistor "base" pin connecting)
The transistor is also no failure

okmn

Quote from: Pepe on Jun 03, 2024, 01:24 PMTable 9-5. Core Registers
Addresses in BANKx Core Registers
x00h or x80h INDF0
x01h or x81h INDF1
x02h or x82h PCL
x03h or x83h STATUS
x04h or x84h FSR0L
x05h or x85h FSR0H
x06h or x86h FSR1L
x07h or x87h FSR1H
x08h or x88h BSR
x09h or x89h WREG
x0Ah or x8Ah PCLATH
x0Bh or x8Bh INTCON

add this in your program
PIR0bits_TMR0IF = 0

Asm
Movlb 0x0
EndAsm

INTCONbits_PEIE = 1 'Peripheral Interrupt enabled
INTCONbits_GIE = 1  'Global Interrupt enabled
PIE0bits_TMR0IE = 1 'TMR0 Interrupt enabled
T0CON0Bits_T0EN = 1 'Timer0 Enabled


because we need to return to bank zero to assign intcon

this is bad
F1_000060 equ $ ; in [LEDS.BAS] PIR0.5 = 0
    movlb 0x0E
    bcf PIR0,5
F1_000065 equ $ ; in [LEDS.BAS] INTCON.6 = 1
    bsf INTCON,6
F1_000066 equ $ ; in [LEDS.BAS] INTCON.7 = 1
    bsf INTCON,7
F1_000067 equ $ ; in [LEDS.BAS] PIE0.5 = 1
    bsf PIE0,5
F1_000068 equ $ ; in [LEDS.BAS] T0CON0.7 = 1

this is correct
F1_000060 equ $ ; in [LEDS.BAS] PIR0.5 = 0
    movlb 0x0E
    bcf PIR0,5


    movlb 0x0


F1_000065 equ $ ; in [LEDS.BAS] INTCON.6 = 1
    bsf INTCON,6
F1_000066 equ $ ; in [LEDS.BAS] INTCON.7 = 1
    bsf INTCON,7
F1_000067 equ $ ; in [LEDS.BAS] PIE0.5 = 1

    movlb 0x0E

    bsf PIE0,5
F1_000068 equ $ ; in [LEDS.BAS] T0CON0.7 = 1

i added it 
nothing change.
 only rc0 blinking.


top204

Try replacing the line:

T0CON1 = %01010010

with

T0CON1 = %01000000

You will find it in the Timer0_Init procedure.

It seems as though I forgot to change that SFR's contents and it is set for a PIC18F26K40 device's Timer0 overflow and will actually syncronise the Timer0 and not allow it to work correctly on a PIC16F15223 device. I wish microchip would leave peripherals alone that do not need changing, and at least keep SFR bit settings as standard.