interrupt on change 12F1840

52 views
Skip to first unread message

hans

unread,
Jan 28, 2023, 4:05:30 AM1/28/23
to jallib
Hello all,
I would like to apply an interrupt on change in a 12F1840. Does anyone have an example of this?
retgards
Hans

Rob CJ

unread,
Jan 28, 2023, 4:43:37 AM1/28/23
to jal...@googlegroups.com
Hi Hans,

Did you check the interrupt on change sample file?

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens hans <hanz...@zeelandnet.nl>
Verzonden: zaterdag 28 januari 2023 10:05
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] interrupt on change 12F1840
 
--
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/65c3df4a-bc83-487b-b058-e67fa7ef3029n%40googlegroups.com.

hans

unread,
Jan 28, 2023, 5:49:07 AM1/28/23
to jallib
Hi Rob,
I have tried but Yes but this one has no port B

Op zaterdag 28 januari 2023 om 10:43:37 UTC+1 schreef rob...@hotmail.com:

hans

unread,
Jan 28, 2023, 5:53:44 AM1/28/23
to jallib
Op zaterdag 28 januari 2023 om 11:49:07 UTC+1 schreef hans:
12F1840_interrupt_on_change.jal

Rob CJ

unread,
Jan 28, 2023, 9:00:23 AM1/28/23
to jal...@googlegroups.com
Hi Hans,

I saw indeed that the library supports only port b. It can be fixed with aliases to also support port a but that need some work because the library is quite large.

I tried to see if it compiles when I add aliases for only port a and only 1 pin and that compiles. Attached your program with using only one pin and a draft update of the change. You can at least test if 1 pin works 🙂

Note that this library is just a hack and far from complete! I was thinking of making the change in a different way so that it requires less work.

So if you are patient I can make the change.

Kind regards,

Rob


Verzonden: zaterdag 28 januari 2023 11:53
Aan: jallib <jal...@googlegroups.com>
Onderwerp: Re: [jallib] interrupt on change 12F1840
 
12F1840_interrupt_on_change.jal
interrupt_on_change_draft.jal

Rob CJ

unread,
Jan 28, 2023, 10:46:29 AM1/28/23
to jal...@googlegroups.com
Hi Hans,

I had a look at the library but with the current set-up I cannot solve it with aliases since PICs can have multiple ports that support interrupt on change and the library only works for one port (B).

I will give it some more thought ....

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Rob CJ <rob...@hotmail.com>
Verzonden: zaterdag 28 januari 2023 15:00
Aan: jal...@googlegroups.com <jal...@googlegroups.com>

Rob CJ

unread,
Jan 28, 2023, 11:15:05 AM1/28/23
to jal...@googlegroups.com
Hi Hans,

It was easier to update your program than changing the library. I think with the current set-up is it not easy to change the library but maybe someone else has a brilliant idea.

Attached your program version that compiles and not using the library. It was not tested, I leave that up to you.

Kind regards,

Rob


Verzonden: zaterdag 28 januari 2023 16:46
12F1840_interrupt_on_change.jal

hans

unread,
Jan 28, 2023, 2:33:41 PM1/28/23
to jallib
Hi Rob,
Works fine,, base for a sample ??
regards
Hans

Op zaterdag 28 januari 2023 om 17:15:05 UTC+1 schreef rob...@hotmail.com:

Rob CJ

unread,
Jan 28, 2023, 2:42:08 PM1/28/23
to jal...@googlegroups.com
Hi Hans,

Good to hear that. I could add it as sample file as a version that does not use a library.

Kind regards,

Rob


Verzonden: zaterdag 28 januari 2023 20:33

Matthew Schinkel

unread,
Jan 30, 2023, 5:35:12 PM1/30/23
to jallib
Should we remove the interrupt on change library?

This sample shows a good example of how to use interrupt on change without a library:
18f4620_interrupt_on_change_pin_b0.jal

Or does someone want to update the library?

Matt.

hans

unread,
Jan 31, 2023, 1:47:28 AM1/31/23
to jallib
Hi Matt,
Please leave it so it is, i use it in older programs.
regards
Hans

Op maandag 30 januari 2023 om 23:35:12 UTC+1 schreef mattsc...@hotmail.com:

Rob CJ

unread,
Jan 31, 2023, 12:58:14 PM1/31/23
to jallib
Hi Matt,

I had a look at the library but with the current - but clever - set-up it is not easy to change by using the same set-up.

Since I updated the sample program of Hans I can add that too as a sample file that does not use the library.

Kind regards,

Rob


Verzonden: dinsdag 31 januari 2023 07:47

Matthew Schinkel

unread,
Jan 31, 2023, 5:51:09 PM1/31/23
to jallib
We could remove the samples related to the interrupt on change library, and keep the lib where it is or rename it.

Rob, is there a better way to make a library? Ideally we would want one library that works on all devices.

Matt.

Rob CJ

unread,
Feb 4, 2023, 3:52:40 AM2/4/23
to jal...@googlegroups.com
Hi Matt,

Maybe indeed a good suggestion to only keep the samples that do not use the library.

I am thinking if there is another way to build the library so let's wait a while before removing samples. 

For now I would just keep it in the upcoming release.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Matthew Schinkel <mattsc...@hotmail.com>
Verzonden: dinsdag 31 januari 2023 23:51
Reply all
Reply to author
Forward
0 new messages