Port B interrupt on change.

Moderator: Benj

Post Reply
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:

Port B interrupt on change.

Post by medelec35 »

With Flowcode 4.1.1.55. Creating new Dual stopwatch which has 1/100 sec, sec, min and hours. Target is 16F887. Project, will have two separate times for on and off periods. When i/p changed form one state to another, a thermistor is read , temperature will be displayed against both times.

All is working so far except interrupt on portB Change (IOC) for B0 – B3 is not working in simulation.
Looking at datasheet there is IOC for port B0 – B7.

Also interrupt properties is correctly allowing selection of B0 – B7 since IOC is maskable

Not tested on hardware yet, I’m guessing its simulation issue and not hardware. I will check when I have some time.

Is there a fix round this please?
Martin

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: Port B interrupt on change.

Post by saschech@gmx.de »

Hallo Benj, Steve,Sean

Please have a look at the V4 int-prog.
It count down every time,although i set all port_B-pins to off ??

Regards wolfgang
Attachments
Test_V4 port_int.fcf
(8 KiB) Downloaded 371 times

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: Port B interrupt on change.

Post by medelec35 »

@ saschech@gmx.de
Problem with your flowchart is you have both switches and display connected to same port. Therefore when display ports are changed, then your port B interrupts are called.
If you want to find out about IOC bug, then you will need to change your display from port B to say port D

Here is my dual stopwatch. Note: I have designed it to stopwatch only starts (upper one), when B4 goes from low to high.
When B4 goes back to low upper stopwatch stops, lower stopwatch starts. then when B4 back to high. lower stopwatch stops counting. This is not finished yet. Need to add temperature storage.
There is another bug with IOC port B5, when high, It is continuously calls port B change macro when switch status is not changing!

Another thing that is odd. It could be my mistake, but if simulation is single stepped or run on speed 1000, then when upper stopwatch is running and B4 is switched low, then simulates as expected. However if running simulation on fasted speed, then when upper stopwatch is running and B4 is switched low the upper stopwatch resets. Hmmm is me or not?
Attachments
Stopwatch4 using wrong switches.FCF
(20.61 KiB) Downloaded 372 times
Last edited by medelec35 on Tue Aug 18, 2009 6:23 am, edited 2 times in total.
Martin

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: Port B interrupt on change.

Post by saschech@gmx.de »

@medelec35

ok ,bat why works port-int if i mark all portb pins off?
only the high-nibble take an int ,b4...b7?

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: Port B interrupt on change.

Post by medelec35 »

saschech@gmx.de wrote:@medelec35

ok ,bat why works port-int if i mark all portb pins off?
only the high-nibble take an int ,b4...b7?
I know, I Checked on a different simulator and in interrupt properties you just select e.g B1 off;B0 on, then that's what will work.
It is just Flowcode simulator bugged not compiled code. Still can't complain, most of V4.1of it is working really well, and is definitely worth investing in. Most bugs have been removed. Hope don't have to wait until V4.2 until simulator corrected. I'm sure those nice engineers at Matrix <in creap mode :P > can sort problem out Very soon 8) .....please!
Martin

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: Port B interrupt on change.

Post by medelec35 »

Forgot to say: when switches have changed state in Flowcode simulator, change detection is sometimes missed as though switch not change state.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Port B interrupt on change.

Post by Benj »

Thanks for this Medelec ill add this one to the list too.

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: Port B interrupt on change.

Post by medelec35 »

Benj wrote:Thanks for this Medelec ill add this one to the list too.
Is there a projected SW release date please?
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Port B interrupt on change.

Post by Benj »

Hello Medelec

Im not sure about this one it would mean a change to the underlying Flowcode simulation which may involve a lot of work.

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: Port B interrupt on change.

Post by medelec35 »

Benj wrote:Hello Medelec

Im not sure about this one it would mean a change to the underlying Flowcode simulation which may involve a lot of work.
Which part would cause problem?

Ports 0 - 3 not detected
or
Not always detecting switch change
or both?
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Port B interrupt on change.

Post by Benj »

I think its probably both at the moment though im not really the expert I just make sure the code that is generated behaives as it should. Both problems have been entered onto our system.

Post Reply