View previous topic :: View next topic |
Author |
Message |
PICmodule
Joined: 26 Oct 2021 Posts: 32
|
|
Posted: Thu Jun 29, 2023 10:45 am |
|
|
Hi,
I wrote new I2C handler that is working with all (bad and good) hardware
Will release to publicity tomorrow. It is universal for any 24 version |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Jul 03, 2023 9:39 am |
|
|
There is one tiny thing that might have been causing problems, and
potentially still may.
unsigned int8 dummy;
Make this into a static.
The issue is that I see you are using interrupt priorities, and therefore
potentially interrupt nesting. The compiler as of a number of versions ago,
does not protect variables between each other when they are in different
interrupt levels. Hence it is possible that the 'dummy' variable could
overwrite another variable in a lower priority interrupt. Could give little
glitches that are hell to diagnose. So rule of thumb, when using nested
interrupts make sure that all variables used in the highest level are declared
as static so they are protected. |
|
|
PICmodule
Joined: 26 Oct 2021 Posts: 32
|
|
Posted: Mon Jul 03, 2023 2:23 pm |
|
|
I finalized this routine, just need to clean up from my application and working very well on both processors. It is finally different and based on MC. Just please give me 1-2 days to deliver the project and then sit down and clean up my routines and publish them. Working very very well, tested many hundreds times |
|
|
|