Port B interrupt on change.
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Port B interrupt on change.
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?
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
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: Port B interrupt on change.
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
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 426 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Port B interrupt on change.
@ 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?
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 411 times
Last edited by medelec35 on Tue Aug 18, 2009 6:23 am, edited 2 times in total.
Martin
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
Re: Port B interrupt on change.
@medelec35
ok ,bat why works port-int if i mark all portb pins off?
only the high-nibble take an int ,b4...b7?
ok ,bat why works port-int if i mark all portb pins off?
only the high-nibble take an int ,b4...b7?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Port B interrupt on change.
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.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?
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


Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Port B interrupt on change.
Forgot to say: when switches have changed state in Flowcode simulator, change detection is sometimes missed as though switch not change state.
Martin
- 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.
Thanks for this Medelec ill add this one to the list too.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Port B interrupt on change.
Is there a projected SW release date please?Benj wrote:Thanks for this Medelec ill add this one to the list too.
Martin
- 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.
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.
Im not sure about this one it would mean a change to the underlying Flowcode simulation which may involve a lot of work.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Port B interrupt on change.
Which part would cause problem?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.
Ports 0 - 3 not detected
or
Not always detecting switch change
or both?
Martin
- 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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel