PIC10F320 Inturrupts IOC

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

Moderator: Benj

Post Reply
Rob_Johnson
Posts: 14
Joined: Wed Feb 26, 2020 9:49 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

PIC10F320 Inturrupts IOC

Post by Rob_Johnson »

I need to enable "Interrupt on Change" on a PIC10F320, however the flowcode program does not seem to be working correctly, as in the small IC outline is displayed but the pins are not selectable.
I have attached a screen grab showing this.
I have tried all of the 10Fxxx chips withing Flowcode and none of them seem to work. I have checked the Microchip datasheet and it confirms "IOC" is an option for this chip.
I have used this interrupt option on other chips (16Fxxxx etc.) and it functions as expected.

Any help would be appreciated
Regards

Rob
Attachments
pic10f320 interrupt problems.jpg
pic10f320 interrupt problems.jpg (68.04 KiB) Viewed 4316 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 663
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: PIC10F320 Inturrupts IOC

Post by chipfryer27 »

Hi

Looks like a v8 bug as it works fine in v9 and v10.

Regards

Rob_Johnson
Posts: 14
Joined: Wed Feb 26, 2020 9:49 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: PIC10F320 Inturrupts IOC

Post by Rob_Johnson »

Hi ,
Yes, I agree, I have tried to get around it for weeks now as I know FC8 is a bit old now, but my boss won't spring for the latest version at the moment.
Hopefully one of the staff could work out a fix for it.

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 663
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: PIC10F320 Inturrupts IOC

Post by chipfryer27 »

Hi

I'm sure you know already that v10 is more or less free. You just need to pay for your chip pack(s) and a commercial license (if required).

I'm sure someone in Matrix will resolve as it seems a "typo".

I edited the associated FCD file in v8 and now I have options to select pins. I don't have any chips to test with, nor do I know if it will work but...

Meanwhile, could you use a C-code block to set the registers directly?

Regards

Rob_Johnson
Posts: 14
Joined: Wed Feb 26, 2020 9:49 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: PIC10F320 Inturrupts IOC

Post by Rob_Johnson »

Hi again,
Wow, please could you post a copy of your "mod" if possible?

I found a "typo" in a normal adc cal file a while ago, made the correction and now it works but I keep getting reminders that "its not official" lol
I didnt post that as V8 is old now

Yes ver 10 is free, management is just really tight at the moment, maybe I'll put it forward and see what happens anyway

I did look to see if I could correct the file but it went above my capabilities :(

Well any help would be most appreciated, thank you

regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 663
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: PIC10F320 Inturrupts IOC

Post by chipfryer27 »

Hi

I'm reluctant to post any modified file as I don't know if it works nor what could go wrong, and I'm certainly not qualified to advise on changes to FC itself.

Using Notepad++ I compared the FCD file for v8 to other versions that work, and simplistically made a change to see what happened. The change then allowed pin selection re the above problem.

However if you want to try this yourself, at your own risk, open the FCD file for the chip (found under ProgramData) and scroll down to the section dealing with IOC Config and around line 150 you will see two lines dealing with rising and falling edges. These are set to "1". Changing to "0" and saving then allowed me to select pins.

I stress that this is entirely at your own risk and other than allowing me to select pins in the chart I have no idea if it will work when translated to hardware, nor if it will screw anything else up.

You do need to use a proper editor such as Notepad++ and it is free to use. You cannot use Windows Notepad nor any other basic Text Editor as these may add in extra characters.

If you do make the mod, the next time you check for updates the file will be overwritten by FC so it can't go too pear shaped for you :)

In the attached chart below I created a simple LED with two buttons both attached to Port A. One button is just attached to Port A, the other is selected via the Interrupt Icon. Pressing the one connected to the Interrupt changes the LED state, the other does nothing and is there just to make sure only the correct pin was enabled. Simulates and compiles to Hex OK (note if in hardware, bounce will likely be an issue).

Regards
Attachments
ISR_INT_IOC.fcfx
(9.8 KiB) Downloaded 62 times

Rob_Johnson
Posts: 14
Joined: Wed Feb 26, 2020 9:49 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: PIC10F320 Inturrupts IOC

Post by Rob_Johnson »

Hi,
Yes, I totally understand your reservations and am greatfull for the information you have posted, I have already looked for such but I used "Windows Notepad" to edit, hence it didn't work, so I replaced with the back up copy, assuming I had got it wrong
You have shown I was on the correct track, just didn't realise the editor might have been at fault.

Thank you so much for your help :)
I will try later today, when work allows etc. and will let you know the outcome.
again thank you so much

regards
Rob

Rob_Johnson
Posts: 14
Joined: Wed Feb 26, 2020 9:49 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: PIC10F320 Inturrupts IOC

Post by Rob_Johnson »

Hi there,
Just wanted to post a BIG THANK YOU to you sir, solved my problem,
the program complies and programmes fine,
the chip functions as expected on bread board etc.
so again, thank you so much :D :D :D

regards
Rob

chipfryer27
Valued Contributor
Valued Contributor
Posts: 663
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: PIC10F320 Inturrupts IOC

Post by chipfryer27 »

Thanks Bob

Glad you are up and running.

Do remember though that until Matrix issues an official update, if you do any full database update then you will overwrite the file (it will show as not genuine). If that happens you will need to redo the mod.

Regards

Post Reply