Help about timer0_isr_interval library for the 16F18313

24 views
Skip to first unread message

flyway38

unread,
May 12, 2022, 1:18:17 PM5/12/22
to jallib
Hello,

Any help will be appreciated!
Am using this PIC16F18313, and need to use his timer.
Using directly timer0_isr_interval Library gives me many errors.
It seems this PIC target library don't use most of timer library variables.
Tried to correct timer library using vars from PIC target library with no success.
Can anyone help in this correction in timer0_isr_interval library.
Thank you very much.

Kind regards
Filipe Santos

Rob CJ

unread,
May 13, 2022, 2:09:36 AM5/13/22
to jal...@googlegroups.com
Hi Filipe,

Can you be more specific? Do you have a sample program that shows the problem?

Thanks.

Van: jal...@googlegroups.com <jal...@googlegroups.com> namens flyway38 <fsfo...@gmail.com>
Verzonden: donderdag 12 mei 2022 19:18
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] Help about timer0_isr_interval library for the 16F18313
 
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/d514ec98-8ca6-41c2-b281-82c67509e6f1n%40googlegroups.com.

flyway38

unread,
May 13, 2022, 7:28:42 AM5/13/22
to jallib

Hi Rob,
Thanks for your time.

Check my error log from compiling the code.

Compilation started at :13/05/2022 12:23:36
jal jalv24q3 (compiled Sep 27 2014)
[Error] (lib/timer0_isr_interval.jal) [Line 56]  "intcon_tmr0ie" not defined
[Error] (lib/timer0_isr_interval.jal) [Line 56]  'end' expected (got 'intcon_tmr0ie')
[Error] (lib/timer0_isr_interval.jal) [Line 56]  {function starts at C:\JALLIB~1\lib/timer0_isr_interval.jal:53}
[Error] (lib/timer0_isr_interval.jal) [Line 56]  "intcon_tmr0ie" not defined
[Error] (lib/timer0_isr_interval.jal) [Line 56]  unexpected token: "intcon_tmr0ie"
[Error] (DMT-TechLogger_v1.09.jal) [Line 190]  "timer0_isr_init" not defined
[Error] (DMT-TechLogger_v1.09.jal) [Line 190]  unexpected token: timer0_isr_init
Compiler CommandLine:  C:\JALLIB~1\compiler\jalv2.exe "C:\Users\Gonçalo\Desktop\DMTM\PIC\DMT-TechLogger_v1.09.jal" -s "C:\JALLIB~1\lib" -no-variable-reuse  

Errors :7       Warnings :0

This error is about " intcon_tmr0ie" var no present in my PIC16F18313 target file.
But I know theres more vars used in timer0_isr_interval libraryt hat also are not present in target file.

Any help would be very appreciated.
Thank you.

Rob CJ

unread,
May 13, 2022, 1:15:20 PM5/13/22
to jal...@googlegroups.com
Hi Filip,

It ahd to do with the fact that newer PICs have different registers and different options. I fixed it with aliases and some small code changes but did not - yet - test this.

See the attached file. Can you copy this file to your local directory (where your main program is) and give it a try?

Thanks.

Kind regards,

Rob


Verzonden: vrijdag 13 mei 2022 13:28
Aan: jallib <jal...@googlegroups.com>
Onderwerp: Re: [jallib] Help about timer0_isr_interval library for the 16F18313
 
timer0_isr_interval.jal

flyway38

unread,
May 13, 2022, 1:59:06 PM5/13/22
to jallib
Hi Rob,

Thank you once again for your input.
Tested it with no luck. Not working as it seems.
Maybe am doing something wrong... here's the relevant code am using;

Setup code:

-- setup the timer0_isr_interval library
const word TIMER0_ISR_RATE = 1000      -- 1 kHz isr rate
const DELAY_SLOTS = 1                  -- support 1 delay at the same time
include ..\Support\timer0_isr_interval_ROB
--include timer0_isr_interval
timer0_isr_init()                      -- init timer0 isr
set_delay(0, 500)

RunTime (inside Forever Loop) code:

   if (check_delay(0)) then
      set_delay(0, 500)
      --
      RlyCtl = !RlyCtl
      CheckBttn()
   end if

Is my code ok?

Cheers,
Filipe Santos

Rob CJ

unread,
May 13, 2022, 2:32:47 PM5/13/22
to jal...@googlegroups.com
Hi Filipe,

I will give it try tomorrow to see why it is not working.

Kind regards,

Rob

Met vriendelijke groet,
Rob Jansen

From: jal...@googlegroups.com <jal...@googlegroups.com> on behalf of flyway38 <fsfo...@gmail.com>
Sent: Friday, May 13, 2022 7:59:06 PM
To: jallib <jal...@googlegroups.com>
Subject: Re: [jallib] Help about timer0_isr_interval library for the 16F18313
 

Rob CJ

unread,
May 14, 2022, 3:39:58 AM5/14/22
to jal...@googlegroups.com
Hi Filip,

I fixed it and tested the attached version on a PIC12F675, which was supported by the original library, and om a PIC16F16323 - which is from the same family as your PIC16F18313, which now supports that newer version too. In the newer PICs you have to explicitly enable timer0 which I forgot.

So this version seems to work fine.  I will add this version later to Jallib so that it becomes part of the next release. For now you could copy this version over the older version you have in your Jallib release.

Please let me know if it works OK for you too.

Thanks.

Kind regards,

Rob


timer0_isr_interval.jal

flyway38

unread,
May 14, 2022, 9:39:47 AM5/14/22
to jallib
Hi Rob,

Good news here.
It is working.
But I found out an almost floating pin that was blocking PIC from working as it should, including the actions that this timer is purposed to do.
So am not sure if your first (NEW) version was working already. Can test it though if needed.
Right now am facing a new problem about the PPS control for this PIC but will open new thread/ post for that.
Thank you very much for all your help.

Kind regards
Filipe Santos.
Reply all
Reply to author
Forward
0 new messages