ECIO40P IOC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

ECIO40P IOC

Post by Steve001 »

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
Attachments
IOC switch test.fcfx
(22.23 KiB) Downloaded 206 times
Success always occurs in private and failure in full view.

User avatar
QMESAR
Valued Contributor
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

Post by QMESAR »

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 :D

medelec35
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

Post by medelec35 »

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

Code: Select all

CountRB0 = 1
At the end of that branch is

Code: Select all

CountRB0 = 0
clearing the CountRB0 flag.
Then further down you have another

Code: Select all

CountRB0 = 1
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

Code: Select all

 countRB1 = 1
, it's decision branch as been duplicated as well!
Martin

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: ECIO40P IOC

Post by Steve001 »

Hi Martin,
medelec35 wrote: Hi Steve, >Have you post the correct flowchart?
:oops: opps no I haven't, I think I have found my issue also gone back to think about it.

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.
It will depend on what point the INT0 has been triggered?
not sure what you mean :?

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 :wink:

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.

Post Reply