Morning All
Using IOC 0 & 1 on an ECIO40P, is there any gotcha's to be aware of?
On my ECIO sometimes didn't pic up the change of state
Program is a test rig that detects two relays changing state then records the voltage that the relay has changed
Steve
ECIO40P IOC
Moderator: Benj
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
ECIO40P IOC
- Attachments
-
- IOC switch test.fcfx
- (22.23 KiB) Downloaded 207 times
Success always occurs in private and failure in full view.
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: ECIO40P IOC
Hi Steve,
I assume the ECIO40 use a PIC18 ,Long time I did not use the IOC feature on these MCU's but I recall some how when using the
IOC pin you need to read the whole port and then mask out which pin changed .otherwise it is not working stable
I might be wrong however worth wile to try or confirm from the Datasheet
Good luck
I assume the ECIO40 use a PIC18 ,Long time I did not use the IOC feature on these MCU's but I recall some how when using the
IOC pin you need to read the whole port and then mask out which pin changed .otherwise it is not working stable
I might be wrong however worth wile to try or confirm from the Datasheet
Good luck
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: ECIO40P IOC
Hi Steve,
Have you post the correct flowchart?
At the end of main there is just a call maro that had not been assigned!
So the code will just stop with nothing on the display at all.
Also within lvd_test macro there is
At the end of that branch is clearing the CountRB0 flag.
Then further down you have another
Since the CountRB0 has already been cleared it will be hit and miss where this will be accessed or not.
It will depend on what point the INT0 has been triggered?
However since this macro has not been called, it will not show anything on the display at all.
Same with, it's decision branch as been duplicated as well!
Have you post the correct flowchart?
At the end of main there is just a call maro that had not been assigned!
So the code will just stop with nothing on the display at all.
Also within lvd_test macro there is
Code: Select all
CountRB0 = 1
Code: Select all
CountRB0 = 0
Then further down you have another
Code: Select all
CountRB0 = 1
It will depend on what point the INT0 has been triggered?
However since this macro has not been called, it will not show anything on the display at all.
Same with
Code: Select all
countRB1 = 1
Martin
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: ECIO40P IOC
Hi Martin,
the relay's react to a falling voltage level I have a couple of boards that I can plug in to the test rig so I have different readings.
they are as is from our PCB manufacturer.
The set points where very close to each other and the wrong way round. (0.8 volts, trip signal happened first, then alarm)
the RB0 & RB1 counter was an attempt to keep the voltage readings for "alarm" and "trip" and detect if the interrupt had happened incase a relay didn't operate.
Theory of operation example
Incoming voltage range 27.4 - 22 volts DC. Start at 27.3 volts
Reduce voltage
PCB Alarm relay de energises @ 23.8 Volts DC
Further reduce voltage
PCB Trip relay de energises @ 22.8 Volts DC
my understanding of an interrupt - more than likely wrong
when IOC pin changes state the interrupt will then go away from the main program do something else then return ?
Steve
:Edit - found another IOC example on the WIKI going to have another play with this also
opps no I haven't, I think I have found my issue also gone back to think about it.medelec35 wrote: Hi Steve, >Have you post the correct flowchart?
the relay's react to a falling voltage level I have a couple of boards that I can plug in to the test rig so I have different readings.
they are as is from our PCB manufacturer.
The set points where very close to each other and the wrong way round. (0.8 volts, trip signal happened first, then alarm)
the RB0 & RB1 counter was an attempt to keep the voltage readings for "alarm" and "trip" and detect if the interrupt had happened incase a relay didn't operate.
not sure what you meanIt will depend on what point the INT0 has been triggered?
Theory of operation example
Incoming voltage range 27.4 - 22 volts DC. Start at 27.3 volts
Reduce voltage
PCB Alarm relay de energises @ 23.8 Volts DC
Further reduce voltage
PCB Trip relay de energises @ 22.8 Volts DC
my understanding of an interrupt - more than likely wrong
when IOC pin changes state the interrupt will then go away from the main program do something else then return ?
Steve
:Edit - found another IOC example on the WIKI going to have another play with this also
Success always occurs in private and failure in full view.