[jallib] [jallib build] buildbot success in jallib on jallib-standard

2023-01-12 Thread build
Hi guys,

This is buildbot speaking. I have finished a build of jallib-standard on jallib.
Buildslave for this Build: sebbot

Build Reason: 
Build Source Stamp: HEAD
Blamelist: rob.jansen

Build succeeded!
Logs are attached.

sincerely,
 -The Buildbot

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/E1pGCIf-0003pr-Nl%40casadeyork.com.
Updating '.':

UU   CHANGELOG

UU   TORELEASE

Updated to revision 3884.

2792 samples to validate...

1173 libraries to validate...

All files validated :)

Environment config

JALLIB_ROOT=/home/mattschinkel/jallib/slave/standard/build

JALLIB_REPOS=/home/mattschinkel/jallib/slave/standard/build/include

JALLIB_SAMPLEDIR=/home/mattschinkel/jallib/slave/standard/build/sample

JALLIB_JALV2=/home/mattschinkel/bin/jalv2

JALLIB_PYTHON=python2.7



Time duration: 244 secs

jal jalv25r6 (compiled Oct 29 2021)

Required parameter to hex is missing!

no source file, use /home/mattschinkel/bin/jalv2 --help for help

Error while compiling file (status=1).

See previous message.

2792 samples to compile...

All samples compile :)

Environment config

JALLIB_ROOT=/home/mattschinkel/jallib/slave/standard/build

JALLIB_REPOS=/home/mattschinkel/jallib/slave/standard/build/include

JALLIB_SAMPLEDIR=/home/mattschinkel/jallib/slave/standard/build/sample

JALLIB_JALV2=/home/mattschinkel/bin/jalv2

JALLIB_PYTHON=python2.7



Time duration: 1905 secs



[jallib] [jallib/jallib] 7ce635: Added new device files and new blink samples.

2023-01-12 Thread 'Rob Jansen' via jallib
  Branch: refs/heads/master
  Home:   https://github.com/jallib/jallib
  Commit: 7ce635ca52cf913097a64b81aa32081941dca44c
  
https://github.com/jallib/jallib/commit/7ce635ca52cf913097a64b81aa32081941dca44c
  Author: Rob Jansen <12682653+robjanse...@users.noreply.github.com>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
M CHANGELOG
M TORELEASE

  Log Message:
  ---
  Added new device files and new blink samples.

For 16f18056 and 16f18076.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/jallib/jallib/push/refs/heads/master/dc52d8-7ce635%40github.com.


Re: [jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread Rob CJ
Hi Oliver,

Thanks for the feedback. I was not sure indeed.

Kind regards,

Rob


Van: 'Oliver Seitz' via jallib 
Verzonden: donderdag 12 januari 2023 19:29
Aan: jallib@googlegroups.com 
Onderwerp: Re: [jallib] PIC16F19176 use same function to check 2 input pins

Sorry, Rob, little mistake:

You need to check the PORTC register. The LATC register contains the output 
pattern, not the input state of the port pins.

Otherwise a good idea :-)

Greets,
Kiste

Am Donnerstag, 12. Januar 2023 um 19:11:43 MEZ hat flyway38 
 Folgendes geschrieben:


Hi Rob,

WOW, nice trick.
Will check if works.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 6:06:35 PM UTC rob...@hotmail.com wrote:
Hi Filipe,

I never tried this but here is a thought.

The pin on a specific port can be found in the LATx register, example below for 
portc this is LATC.

You find this in your device file for e.g. pin_C2
var volatile bitLATC_LATC2at LATC : 2
var volatile bitpin_C2at PORTC : 2

So if you have for example your buttons on port C you could pass a 'mask' as 
parameter to the procedure. Example below (not compiled):

function pin_active(byte in pin_mask) return bit
   return (LATC & pin_mask)
end function

So if you want to if test pin C1 is active (HIGH) or pin C7 is active (HIGH) 
you do:

if  pin_active(0b_0010) then
   -- Do something for bin C1
   end if
   if pin_active(0b1000_) then
  --  Do something for pin C7
end if

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 12:07
Aan: jallib 
Onderwerp: [jallib] PIC16F19176 use same function to check 2 input pins

Hello,

Need help to use same function wich cheks for an input pin as a buttn.
But now need to implement new input pin as another button.
How to pass to that function which pin to read?
Can I use "byte in device" in its input parameters?
Thank you very much.

Kind regards,
Filipe Santos

--
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/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com.

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/404b1de4-c3cd-47b4-a12e-1f7dce577e91n%40googlegroups.com.

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/1273200153.331767.1673548195785%40mail.yahoo.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB16372CFC54AA6E018BBB28A3E6FD9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.


Re: [jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread 'Oliver Seitz' via jallib
 Sorry, Rob, little mistake:
You need to check the PORTC register. The LATC register contains the output 
pattern, not the input state of the port pins.
Otherwise a good idea :-)
Greets,Kiste
Am Donnerstag, 12. Januar 2023 um 19:11:43 MEZ hat flyway38 
 Folgendes geschrieben:  
 
 Hi Rob,
WOW, nice trick.Will check if works.Thank you very much.
Cheers,FS

On Thursday, January 12, 2023 at 6:06:35 PM UTC rob...@hotmail.com wrote:

Hi Filipe,
I never tried this but here is a thought.
The pin on a specific port can be found in the LATx register, example below for 
portc this is LATC.
You find this in your device file for e.g. pin_C2var volatile bit    LATC_LATC2 
               at LATC : 2var volatile bit    pin_C2                    at 
PORTC : 2
So if you have for example your buttons on port C you could pass a 'mask' as 
parameter to the procedure. Example below (not compiled):
function pin_active(byte in pin_mask) return bit   return (LATC & pin_mask)end 
function
So if you want to if test pin C1 is active (HIGH) or pin C7 is active (HIGH) 
you do:
    if  pin_active(0b_0010) then       -- Do something for bin C1   end if  
  if pin_active(0b1000_) then      --  Do something for pin C7    end if 
Kind regards,
Rob
Van: jal...@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 12:07
Aan: jallib 
Onderwerp: [jallib] PIC16F19176 use same function to check 2 input pins Hello,
Need help to use same function wich cheks for an input pin as a buttn.But now 
need to implement new input pin as another button.How to pass to that function 
which pin to read?Can I use "byte in device" in its input parameters?Thank you 
very much.
Kind regards,Filipe Santos


-- 
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 
tojallib+un...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com.



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/404b1de4-c3cd-47b4-a12e-1f7dce577e91n%40googlegroups.com.
  

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/1273200153.331767.1673548195785%40mail.yahoo.com.


Re: [jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread Rob CJ
Hi Filipe,

One correction. The return statement should be something like.
   return (LATC & pin_mask) != 0

Let me know if it works, I never tried it myself.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 19:11
Aan: jallib 
Onderwerp: Re: [jallib] PIC16F19176 use same function to check 2 input pins

Hi Rob,

WOW, nice trick.
Will check if works.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 6:06:35 PM UTC rob...@hotmail.com wrote:
Hi Filipe,

I never tried this but here is a thought.

The pin on a specific port can be found in the LATx register, example below for 
portc this is LATC.

You find this in your device file for e.g. pin_C2
var volatile bitLATC_LATC2at LATC : 2
var volatile bitpin_C2at PORTC : 2

So if you have for example your buttons on port C you could pass a 'mask' as 
parameter to the procedure. Example below (not compiled):

function pin_active(byte in pin_mask) return bit
   return (LATC & pin_mask)
end function

So if you want to if test pin C1 is active (HIGH) or pin C7 is active (HIGH) 
you do:

if  pin_active(0b_0010) then
   -- Do something for bin C1
   end if
   if pin_active(0b1000_) then
  --  Do something for pin C7
end if

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 12:07
Aan: jallib 
Onderwerp: [jallib] PIC16F19176 use same function to check 2 input pins

Hello,

Need help to use same function wich cheks for an input pin as a buttn.
But now need to implement new input pin as another button.
How to pass to that function which pin to read?
Can I use "byte in device" in its input parameters?
Thank you very much.

Kind regards,
Filipe Santos

--
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/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com.

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/404b1de4-c3cd-47b4-a12e-1f7dce577e91n%40googlegroups.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB1637E957AAEFEBD9A4E8E18FE6FD9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.


Re: [jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread flyway38
Hi Rob,

WOW, nice trick.
Will check if works.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 6:06:35 PM UTC rob...@hotmail.com wrote:

> Hi Filipe,
>
> I never tried this but here is a thought.
>
> The pin on a specific port can be found in the LATx register, example 
> below for portc this is LATC.
>
> You find this in your device file for e.g. pin_C2
> var volatile bitLATC_LATC2at LATC : 2 
> var volatile bitpin_C2at PORTC : 2
>
> So if you have for example your buttons on port C you could pass a 'mask' 
> as parameter to the procedure. Example below (not compiled):
>
> function pin_active(byte in pin_mask) return bit
>return (LATC & pin_mask)
> end function
>
> So if you want to if test pin C1 is active (HIGH) or pin C7 is active 
> (HIGH) you do:
>
> if  pin_active(0b_0010) then
>-- Do something for bin C1
>end if 
>if pin_active(0b1000_) then
>   --  Do something for pin C7
> end if 
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens flyway38 <
> fsfo...@gmail.com>
> *Verzonden:* donderdag 12 januari 2023 12:07
> *Aan:* jallib 
> *Onderwerp:* [jallib] PIC16F19176 use same function to check 2 input pins 
>  
> Hello,
>
> Need help to use same function wich cheks for an input pin as a buttn.
> But now need to implement new input pin as another button.
> How to pass to that function which pin to read?
> Can I use "byte in device" in its input parameters?
> Thank you very much.
>
> Kind regards,
> Filipe Santos
>
> -- 
> 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/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com
>  
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/404b1de4-c3cd-47b4-a12e-1f7dce577e91n%40googlegroups.com.


Re: [jallib] PIC16F19176 rtc help

2023-01-12 Thread flyway38
Hi Rob,

Thank you for your information.
Will test and back here with results.

Cheers,
FS

On Thursday, January 12, 2023 at 5:55:18 PM UTC rob...@hotmail.com wrote:

> Hi Filipe,
>
> That timer library is using interrupts but if the code in your forever 
> loop has a delay you will not benefit from it.
>
> So what should be done is that the action you want to execute when the 
> timer has an interrupt should be part of that timer0 interrupt routine and 
> not in your forever loop. Some libraries - but not this one - have an 
> option to call a user defined procedure when it is defined.
>
> A quick - and dirty - fix is to make a local copy of this timer library 
> and add your specific code to the procedure ISR() in timer0_isr_interval. 
> Note that when you do that, your code must be fast since interrupt routine 
> should be a short as possible.
>
> An option would be to extend this library and call a user defined 
> procedure from the timer interrupt if it was defined by the user.
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens flyway38 <
> fsfo...@gmail.com>
> *Verzonden:* donderdag 12 januari 2023 12:02
>
> *Aan:* jallib 
> *Onderwerp:* Re: [jallib] PIC16F19176 rtc help
> Hello Rob,
>
> Yes, am using this code:
> -- This program uses the internal oscillator at 32 MHz.
> pragma target clock32_000_000  -- oscillator frequency
> pragma target OSC  OFF -- internal oscillator
> pragma target RSTOSC   HFINT32 -- select 32 MHz
> pragma target CLKOUTEN DISABLED-- no clock output
> pragma target WDT  DISABLED-- watchdog
> pragma target BROWNOUT DISABLED-- no brownout reset
> pragma target FCMENDISABLED-- no clock monitoring
> pragma target CSWENENABLED -- allow writing OSCCON1 NOSC and NDIV
> pragma target LVP  ENABLED -- low voltage programming
> pragma target MCLR INTERNAL-- internal reset
> --
> OSCFRQ_HFFRQ = 0b110   -- Fosc 32 -> 32 MHz
> --OSCCON2 = 0x00   -- 32 MHz and no division
> --
> -- Enable weak pull up for all inputs.
> --WPUA = 0b_
> WPUB = 0b_
> WPUC = 0b_
> WPUD = 0b_
> WPUE = 0b_
>
> ...
>
> -- Timer0_isr_interval Lib
> const DELAY_SLOTS = 1  -- support 2 delays at the same time
> const word TIMER0_ISR_RATE = 1000  -- 1 kHz isr rate
> include timer0_isr_interval
> timer0_isr_init()  -- init timer0 isr
> --
> set_delay(0, 2_000)-- Init timer0 pointer
> var word wTimeSync = 0 -- Init Time Sync clock
>
> And inside FOREVER LOOP:
>-- Checking TIMER0 - Time Sync
>if (check_delay(0)) then
>   wTimeSync = wTimeSync + 1
>   --
>   -- ticks (of 2s) on delay-slot 0
>   set_delay(0, 2_000)
>   --
>  if (!LedAM & wTimeSync%10 == 0) then 
>  Krnl_CheckModem()
>   end if
>end if
>
> Problem is this code don't use interrupts.
> So my var "wTimerSync" don't get updated when PIC is doing longer time 
> consuming tasks...
> Can you help?
> Thank you.
>
> Cheers,
> FS
> On Thursday, January 12, 2023 at 9:59:11 AM UTC rob...@hotmail.com wrote:
>
> Hi Filipe,
>
> In that case you could use a timer. Did you have a look at a timer library?
>
> Met vriendelijke groet,
> Rob Jansen 
> --
> *From:* jal...@googlegroups.com  on behalf of 
> flyway38 
> *Sent:* Thursday, January 12, 2023 10:16:41 AM
> *To:* jallib 
> *Subject:* Re: [jallib] PIC16F19176 rtc help 
>  
> Hi Rob and Vasile,
>
> Thank you for your input.
> My code is very big (and confuse) by now.
> Anyways, only need an effective RTC to increment a variable, no matter 
> what PIC is doing...
> Problem is I have no experience using interrupts (software ones) with PICs.
>
> Good point about that second oscillator. Remember now, my eyes crossing 
> that info in the datasheet...
> But, I think that will not need that. I don't need a precise RTC. My code 
> will use a time base of 10seconds.
> Problem is when PIC is doing some actions like reading SMSs, deleting 
> SMSs, resetting modem, etc those actions take almost a minute, so I 
> need interrupts to keep track of elapsed time.
> Thank you very much.
>
> Cheers,
> FS
>
> On Thursday, January 12, 2023 at 5:09:14 AM UTC vasile wrote:
>
> Yep. If a secondary oscillator available, definitely yes for the RTC, 
> except maybe for running at -20C where a good TCXO is expensive, using only 
> one could be an option.
> Apples with pears are still fruits, not very bad comparison. :)
>
> On Wed, Jan 11, 2023 at 7:46 PM Rob CJ  wrote:
>
> Hi Filipe,
>
> It helps if you send your program otherwise we are comparing apples with 
> pears.
>
> There is another possibility. Your PIC has a secondary oscillator, meant 
> for connecting a 32 kHz crystal. If you use that, you can make your own RTC 
> and the only thing you need is a 32 kHz crystal and a small piece of 
> software.
>
> Kind regards,
>
> Rob
>
> 

Re: [jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread Rob CJ
Hi Filipe,

I never tried this but here is a thought.

The pin on a specific port can be found in the LATx register, example below for 
portc this is LATC.

You find this in your device file for e.g. pin_C2
var volatile bitLATC_LATC2at LATC : 2
var volatile bitpin_C2at PORTC : 2

So if you have for example your buttons on port C you could pass a 'mask' as 
parameter to the procedure. Example below (not compiled):

function pin_active(byte in pin_mask) return bit
   return (LATC & pin_mask)
end function

So if you want to if test pin C1 is active (HIGH) or pin C7 is active (HIGH) 
you do:

if  pin_active(0b_0010) then
   -- Do something for bin C1
   end if
   if pin_active(0b1000_) then
  --  Do something for pin C7
end if

Kind regards,

Rob


Van: jallib@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 12:07
Aan: jallib 
Onderwerp: [jallib] PIC16F19176 use same function to check 2 input pins

Hello,

Need help to use same function wich cheks for an input pin as a buttn.
But now need to implement new input pin as another button.
How to pass to that function which pin to read?
Can I use "byte in device" in its input parameters?
Thank you very much.

Kind regards,
Filipe Santos

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB16376797E65DD89AC3F288C6E6FD9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.


Re: [jallib] PIC16F19176 rtc help

2023-01-12 Thread Rob CJ
Hi Filipe,

That timer library is using interrupts but if the code in your forever loop has 
a delay you will not benefit from it.

So what should be done is that the action you want to execute when the timer 
has an interrupt should be part of that timer0 interrupt routine and not in 
your forever loop. Some libraries - but not this one - have an option to call a 
user defined procedure when it is defined.

A quick - and dirty - fix is to make a local copy of this timer library and add 
your specific code to the procedure ISR() in timer0_isr_interval. Note that 
when you do that, your code must be fast since interrupt routine should be a 
short as possible.

An option would be to extend this library and call a user defined procedure 
from the timer interrupt if it was defined by the user.

Kind regards,

Rob


Van: jallib@googlegroups.com  namens flyway38 

Verzonden: donderdag 12 januari 2023 12:02
Aan: jallib 
Onderwerp: Re: [jallib] PIC16F19176 rtc help

Hello Rob,

Yes, am using this code:
-- This program uses the internal oscillator at 32 MHz.
pragma target clock32_000_000  -- oscillator frequency
pragma target OSC  OFF -- internal oscillator
pragma target RSTOSC   HFINT32 -- select 32 MHz
pragma target CLKOUTEN DISABLED-- no clock output
pragma target WDT  DISABLED-- watchdog
pragma target BROWNOUT DISABLED-- no brownout reset
pragma target FCMENDISABLED-- no clock monitoring
pragma target CSWENENABLED -- allow writing OSCCON1 NOSC and NDIV
pragma target LVP  ENABLED -- low voltage programming
pragma target MCLR INTERNAL-- internal reset
--
OSCFRQ_HFFRQ = 0b110   -- Fosc 32 -> 32 MHz
--OSCCON2 = 0x00   -- 32 MHz and no division
--
-- Enable weak pull up for all inputs.
--WPUA = 0b_
WPUB = 0b_
WPUC = 0b_
WPUD = 0b_
WPUE = 0b_

...

-- Timer0_isr_interval Lib
const DELAY_SLOTS = 1  -- support 2 delays at the same time
const word TIMER0_ISR_RATE = 1000  -- 1 kHz isr rate
include timer0_isr_interval
timer0_isr_init()  -- init timer0 isr
--
set_delay(0, 2_000)-- Init timer0 pointer
var word wTimeSync = 0 -- Init Time Sync clock

And inside FOREVER LOOP:
   -- Checking TIMER0 - Time Sync
   if (check_delay(0)) then
  wTimeSync = wTimeSync + 1
  --
  -- ticks (of 2s) on delay-slot 0
  set_delay(0, 2_000)
  --
 if (!LedAM & wTimeSync%10 == 0) then
 Krnl_CheckModem()
  end if
   end if

Problem is this code don't use interrupts.
So my var "wTimerSync" don't get updated when PIC is doing longer time 
consuming tasks...
Can you help?
Thank you.

Cheers,
FS
On Thursday, January 12, 2023 at 9:59:11 AM UTC rob...@hotmail.com wrote:
Hi Filipe,

In that case you could use a timer. Did you have a look at a timer library?

Met vriendelijke groet,
Rob Jansen

From: jal...@googlegroups.com  on behalf of flyway38 

Sent: Thursday, January 12, 2023 10:16:41 AM
To: jallib 
Subject: Re: [jallib] PIC16F19176 rtc help

Hi Rob and Vasile,

Thank you for your input.
My code is very big (and confuse) by now.
Anyways, only need an effective RTC to increment a variable, no matter what PIC 
is doing...
Problem is I have no experience using interrupts (software ones) with PICs.

Good point about that second oscillator. Remember now, my eyes crossing that 
info in the datasheet...
But, I think that will not need that. I don't need a precise RTC. My code will 
use a time base of 10seconds.
Problem is when PIC is doing some actions like reading SMSs, deleting SMSs, 
resetting modem, etc those actions take almost a minute, so I need 
interrupts to keep track of elapsed time.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 5:09:14 AM UTC vasile wrote:
Yep. If a secondary oscillator available, definitely yes for the RTC, except 
maybe for running at -20C where a good TCXO is expensive, using only one could 
be an option.
Apples with pears are still fruits, not very bad comparison. :)

On Wed, Jan 11, 2023 at 7:46 PM Rob CJ  wrote:
Hi Filipe,

It helps if you send your program otherwise we are comparing apples with pears.

There is another possibility. Your PIC has a secondary oscillator, meant for 
connecting a 32 kHz crystal. If you use that, you can make your own RTC and the 
only thing you need is a 32 kHz crystal and a small piece of software.

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: woensdag 11 januari 2023 14:53
Aan: jallib 
Onderwerp: Re: [jallib] PIC16F19176 rtc help

Hello Vasile,

I think that have already tried that sample, but as said before, think i fall 
into some LIB errors...
Will check again, but maybe get stuck while adapting it to my PIC...
Will back here with results.
Thank you very much.

Cheers,
FS

On Wednesday, January 11, 2023 at 

[jallib] PIC16F19176 use same function to check 2 input pins

2023-01-12 Thread flyway38
Hello,

Need help to use same function wich cheks for an input pin as a buttn.
But now need to implement new input pin as another button.
How to pass to that function which pin to read?
Can I use "byte in device" in its input parameters?
Thank you very much.

Kind regards,
Filipe Santos

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/f5fa42aa-c132-49d8-b5ae-5b141a9d927fn%40googlegroups.com.


Re: [jallib] PIC16F19176 rtc help

2023-01-12 Thread flyway38
Hello Rob,

Yes, am using this code:
-- This program uses the internal oscillator at 32 MHz.
pragma target clock32_000_000  -- oscillator frequency
pragma target OSC  OFF -- internal oscillator
pragma target RSTOSC   HFINT32 -- select 32 MHz
pragma target CLKOUTEN DISABLED-- no clock output
pragma target WDT  DISABLED-- watchdog
pragma target BROWNOUT DISABLED-- no brownout reset
pragma target FCMENDISABLED-- no clock monitoring
pragma target CSWENENABLED -- allow writing OSCCON1 NOSC and NDIV
pragma target LVP  ENABLED -- low voltage programming
pragma target MCLR INTERNAL-- internal reset
--
OSCFRQ_HFFRQ = 0b110   -- Fosc 32 -> 32 MHz
--OSCCON2 = 0x00   -- 32 MHz and no division
--
-- Enable weak pull up for all inputs.
--WPUA = 0b_
WPUB = 0b_
WPUC = 0b_
WPUD = 0b_
WPUE = 0b_

...

-- Timer0_isr_interval Lib
const DELAY_SLOTS = 1  -- support 2 delays at the same time
const word TIMER0_ISR_RATE = 1000  -- 1 kHz isr rate
include timer0_isr_interval
timer0_isr_init()  -- init timer0 isr
--
set_delay(0, 2_000)-- Init timer0 pointer
var word wTimeSync = 0 -- Init Time Sync clock

And inside FOREVER LOOP:
   -- Checking TIMER0 - Time Sync
   if (check_delay(0)) then
  wTimeSync = wTimeSync + 1
  --
  -- ticks (of 2s) on delay-slot 0
  set_delay(0, 2_000)
  --
 if (!LedAM & wTimeSync%10 == 0) then 
 Krnl_CheckModem()
  end if
   end if

Problem is this code don't use interrupts.
So my var "wTimerSync" don't get updated when PIC is doing longer time 
consuming tasks...
Can you help?
Thank you.

Cheers,
FS
On Thursday, January 12, 2023 at 9:59:11 AM UTC rob...@hotmail.com wrote:

> Hi Filipe,
>
> In that case you could use a timer. Did you have a look at a timer library?
>
> Met vriendelijke groet,
> Rob Jansen 
> --
> *From:* jal...@googlegroups.com  on behalf of 
> flyway38 
> *Sent:* Thursday, January 12, 2023 10:16:41 AM
> *To:* jallib 
> *Subject:* Re: [jallib] PIC16F19176 rtc help 
>  
> Hi Rob and Vasile,
>
> Thank you for your input.
> My code is very big (and confuse) by now.
> Anyways, only need an effective RTC to increment a variable, no matter 
> what PIC is doing...
> Problem is I have no experience using interrupts (software ones) with PICs.
>
> Good point about that second oscillator. Remember now, my eyes crossing 
> that info in the datasheet...
> But, I think that will not need that. I don't need a precise RTC. My code 
> will use a time base of 10seconds.
> Problem is when PIC is doing some actions like reading SMSs, deleting 
> SMSs, resetting modem, etc those actions take almost a minute, so I 
> need interrupts to keep track of elapsed time.
> Thank you very much.
>
> Cheers,
> FS
>
> On Thursday, January 12, 2023 at 5:09:14 AM UTC vasile wrote:
>
> Yep. If a secondary oscillator available, definitely yes for the RTC, 
> except maybe for running at -20C where a good TCXO is expensive, using only 
> one could be an option.
> Apples with pears are still fruits, not very bad comparison. :)
>
> On Wed, Jan 11, 2023 at 7:46 PM Rob CJ  wrote:
>
> Hi Filipe,
>
> It helps if you send your program otherwise we are comparing apples with 
> pears.
>
> There is another possibility. Your PIC has a secondary oscillator, meant 
> for connecting a 32 kHz crystal. If you use that, you can make your own RTC 
> and the only thing you need is a 32 kHz crystal and a small piece of 
> software.
>
> Kind regards,
>
> Rob
>
> --
> *Van:* jal...@googlegroups.com  namens flyway38 <
> fsfo...@gmail.com>
> *Verzonden:* woensdag 11 januari 2023 14:53
> *Aan:* jallib 
> *Onderwerp:* Re: [jallib] PIC16F19176 rtc help 
>  
> Hello Vasile,
>
> I think that have already tried that sample, but as said before, think i 
> fall into some LIB errors...
> Will check again, but maybe get stuck while adapting it to my PIC...
> Will back here with results.
> Thank you very much.
>
> Cheers,
> FS
>
> On Wednesday, January 11, 2023 at 3:50:33 AM UTC vasile wrote:
>
> Hi Fellipe,
> You will not like my ideea but any rtc can be implemented in any pic, much 
> better than using an external RTC, by using Bresenham zero error algorithm.
>
> It's in the sample and works perfect with all timers. 
>
> It's set to seconds but works down to 1ms for fast pics.
> You have just to set a flag in the isr when time passed and reset it in 
> the main after you have read it.
>
> The only thing to care is the total lenght of your isr, including your own 
> application which must be shorter than time genetated (aka 1 second or 
> shorter).
>
>
> On Tue 10 Jan 2023, 9:25 PM flyway38 
> Hi Rob,
>
> It seems something not working...
> Not sure why, but using your sample (part of it, check below what have 
> integrated in my code from your sample), it doesn't even reach the 

Re: [jallib] PIC16F19176 rtc help

2023-01-12 Thread Rob CJ
Hi Filipe,

In that case you could use a timer. Did you have a look at a timer library?

Met vriendelijke groet,
Rob Jansen

From: jallib@googlegroups.com  on behalf of flyway38 

Sent: Thursday, January 12, 2023 10:16:41 AM
To: jallib 
Subject: Re: [jallib] PIC16F19176 rtc help

Hi Rob and Vasile,

Thank you for your input.
My code is very big (and confuse) by now.
Anyways, only need an effective RTC to increment a variable, no matter what PIC 
is doing...
Problem is I have no experience using interrupts (software ones) with PICs.

Good point about that second oscillator. Remember now, my eyes crossing that 
info in the datasheet...
But, I think that will not need that. I don't need a precise RTC. My code will 
use a time base of 10seconds.
Problem is when PIC is doing some actions like reading SMSs, deleting SMSs, 
resetting modem, etc those actions take almost a minute, so I need 
interrupts to keep track of elapsed time.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 5:09:14 AM UTC vasile wrote:
Yep. If a secondary oscillator available, definitely yes for the RTC, except 
maybe for running at -20C where a good TCXO is expensive, using only one could 
be an option.
Apples with pears are still fruits, not very bad comparison. :)

On Wed, Jan 11, 2023 at 7:46 PM Rob CJ  wrote:
Hi Filipe,

It helps if you send your program otherwise we are comparing apples with pears.

There is another possibility. Your PIC has a secondary oscillator, meant for 
connecting a 32 kHz crystal. If you use that, you can make your own RTC and the 
only thing you need is a 32 kHz crystal and a small piece of software.

Kind regards,

Rob


Van: jal...@googlegroups.com  namens flyway38 

Verzonden: woensdag 11 januari 2023 14:53
Aan: jallib 
Onderwerp: Re: [jallib] PIC16F19176 rtc help

Hello Vasile,

I think that have already tried that sample, but as said before, think i fall 
into some LIB errors...
Will check again, but maybe get stuck while adapting it to my PIC...
Will back here with results.
Thank you very much.

Cheers,
FS

On Wednesday, January 11, 2023 at 3:50:33 AM UTC vasile wrote:
Hi Fellipe,
You will not like my ideea but any rtc can be implemented in any pic, much 
better than using an external RTC, by using Bresenham zero error algorithm.

It's in the sample and works perfect with all timers.

It's set to seconds but works down to 1ms for fast pics.
You have just to set a flag in the isr when time passed and reset it in the 
main after you have read it.

The only thing to care is the total lenght of your isr, including your own 
application which must be shorter than time genetated (aka 1 second or shorter).


On Tue 10 Jan 2023, 9:25 PM flyway38  namens flyway38 

Verzonden: dinsdag 10 januari 2023 19:04
Aan: jallib 
Onderwerp: [jallib] PIC16F19176 rtc help

Hello all,

Need help on coding for an rtc for the 16F19176.
Have tried many samples with no luck. They get alot of failures, like not 
defined terms...
Need to implement a simple RTC code to keep track of time even if PIC is 
handling "closed loop" routines, like reading Comm Port or resetting the gsm 
modem, etc...
Need these routines to get interrupted, and finished after RTC updates time.
It would be a very fast code, only to increment a variable.
Need some sample code adapted for this PIC, please.
Thank you

Kind regards,
Filipe Santos

--
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/4b03768d-331b-4a4c-aa10-afbf73fc952cn%40googlegroups.com.

--
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/792ae118-9ffe-496b-b214-9ef697d45133n%40googlegroups.com.

--
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/2cd70652-2a40-4954-bfef-1b9ec4730363n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this 

Re: [jallib] PIC16F19176 rtc help

2023-01-12 Thread flyway38
Hi Rob and Vasile,

Thank you for your input.
My code is very big (and confuse) by now.
Anyways, only need an effective RTC to increment a variable, no matter what 
PIC is doing...
Problem is I have no experience using interrupts (software ones) with PICs.

Good point about that second oscillator. Remember now, my eyes crossing 
that info in the datasheet...
But, I think that will not need that. I don't need a precise RTC. My code 
will use a time base of 10seconds.
Problem is when PIC is doing some actions like reading SMSs, deleting SMSs, 
resetting modem, etc those actions take almost a minute, so I need 
interrupts to keep track of elapsed time.
Thank you very much.

Cheers,
FS

On Thursday, January 12, 2023 at 5:09:14 AM UTC vasile wrote:

> Yep. If a secondary oscillator available, definitely yes for the RTC, 
> except maybe for running at -20C where a good TCXO is expensive, using only 
> one could be an option.
> Apples with pears are still fruits, not very bad comparison. :)
>
> On Wed, Jan 11, 2023 at 7:46 PM Rob CJ  wrote:
>
>> Hi Filipe,
>>
>> It helps if you send your program otherwise we are comparing apples with 
>> pears.
>>
>> There is another possibility. Your PIC has a secondary oscillator, meant 
>> for connecting a 32 kHz crystal. If you use that, you can make your own RTC 
>> and the only thing you need is a 32 kHz crystal and a small piece of 
>> software.
>>
>> Kind regards,
>>
>> Rob
>>
>> --
>> *Van:* jal...@googlegroups.com  namens flyway38 
>> 
>> *Verzonden:* woensdag 11 januari 2023 14:53
>> *Aan:* jallib 
>> *Onderwerp:* Re: [jallib] PIC16F19176 rtc help 
>>  
>> Hello Vasile,
>>
>> I think that have already tried that sample, but as said before, think i 
>> fall into some LIB errors...
>> Will check again, but maybe get stuck while adapting it to my PIC...
>> Will back here with results.
>> Thank you very much.
>>
>> Cheers,
>> FS
>>
>> On Wednesday, January 11, 2023 at 3:50:33 AM UTC vasile wrote:
>>
>> Hi Fellipe,
>> You will not like my ideea but any rtc can be implemented in any pic, 
>> much better than using an external RTC, by using Bresenham zero error 
>> algorithm.
>>
>> It's in the sample and works perfect with all timers. 
>>
>> It's set to seconds but works down to 1ms for fast pics.
>> You have just to set a flag in the isr when time passed and reset it in 
>> the main after you have read it.
>>
>> The only thing to care is the total lenght of your isr, including your 
>> own application which must be shorter than time genetated (aka 1 second or 
>> shorter).
>>
>>
>> On Tue 10 Jan 2023, 9:25 PM flyway38 >
>> Hi Rob,
>>
>> It seems something not working...
>> Not sure why, but using your sample (part of it, check below what have 
>> integrated in my code from your sample), it doesn't even reach the FOREVER 
>> LOOP...
>> Maybe because am using serial_hw_int_cts instead of serial_hardware, or 
>> even because am using timer0_isr_interval... don't know...
>> Here's what am using from your sample:
>>
>> -- Settings for the RTC and intialization.
>> alias rtc_sck is pin_C0 -- Pin 10 for 14 pin DIP
>> alias rtc_sck_direction is pin_C0_direction
>> alias rtc_sdo is pin_C1 -- Pin 9 for 14 pin DIP.
>> alias rtc_sdo_direction is pin_C1_direction
>> -- If you want to use software IIC, define the following constant.
>> -- const RTC_SOFTWARE_IIC = TRUE
>> include rtc_ds3231
>>
>> -- Setting to check the alarm on a poll basis or interrupt bases. When
>> -- defined the alarms are checked using the external interrupt of the PIC.
>> -- Using the interrupt has its limitations for this rtc as explained in 
>> the
>> -- sample interrupt routine below.
>> -- const ALARM_ON_INTERRUPT = TRUE
>>
>> -- Print the current time of the rtc.
>> procedure print_time() is
>>
>>var byte hours, minutes, seconds
>>
>>rtc_get_time_bin(hours, minutes, seconds)
>>print_string(serial_hw_data, "H:")
>>print_byte_dec(serial_hw_data, hours)
>>print_string(serial_hw_data, " M:")
>>print_byte_dec(serial_hw_data, minutes)
>>print_string(serial_hw_data, " S:")
>>print_byte_dec(serial_hw_data, seconds)
>>print_crlf(serial_hw_data)
>>
>> end procedure
>>
>> -- Example of handling the alarm on an interrupt basis. Note that we 
>> cannot
>> -- call any of the RTC procedures because it will interfere with the IIC
>> -- transmission. We can only set a flag that can be checked later. Note 
>> that
>> -- the interrupt is edge triggered. The rtc interrupt stays low as long as
>> -- the alarm flag of the RTC is set.
>> if defined(ALARM_ON_INTERRUPT) then
>>procedure alarm_interrupt is pragma interrupt
>>   if INTCON_INTF then
>>  INTCON_INTF = FALSE
>>  alarm_was_given = TRUE
>>   end if
>>end procedure
>> end if
>>
>> rtc_init()
>>
>> -- Enable interrupts if setting is defined.
>> if defined(ALARM_ON_INTERRUPT) then
>>INTCON_INTE = TRUE
>>-- Interrupt on falling edge.
>>OPTION_REG_INTEDG = FALSE
>>