Hello All
There is a part of a program (in FC8) on a 16F18344 where all I am doing is using an IOC pin (C2) which just has few pulses coming in. All I am doing is duplication this pulse onto another pin A1. However, for some reason I am getting very short drops in the positive pulses, anyone have any idea's why? The IOC interupt is called near the start of the main program and does not include any other pins and triggers on both edges (there are no other interupts in the program).
Thanks
IOC dilema
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
- 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: IOC dilema
Hello,
To discount anything in your program causing the problem can you disable the other code or at least add a while 1 loop so that it enables the interrupt and then loops forever in main without doing anything else.
I'm thinking maybe an ADC read on that pin or something else similar is maybe switching the pin to an input temporarily.
To discount anything in your program causing the problem can you disable the other code or at least add a while 1 loop so that it enables the interrupt and then loops forever in main without doing anything else.
I'm thinking maybe an ADC read on that pin or something else similar is maybe switching the pin to an input temporarily.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: IOC dilema
Hi Lord Grezington
Disable the NO Output and take a mesurment. If the Pin A1 still goes down, something switch it down (what Ben says)
If it is stable always 1 then you have a IOC problem.(maybe)
regards
Stefan
Disable the NO Output and take a mesurment. If the Pin A1 still goes down, something switch it down (what Ben says)
If it is stable always 1 then you have a IOC problem.(maybe)
regards
Stefan
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
Re: IOC dilema
Thanks Ben & Stefan
Yes, its looks to be the analogue input! How/Why is the analogue input affecting the IOC though when the analogue input is is the main program? Will the anlalogue input (RC4/AN20) still affect the IOC on RC2 just because its on the same port?
I am guessing I need to change RC2 to a general IO and not an analogue input to resolve this problem? I have had a look into the datasheet and I cant seem to find the right register to make the change. Apparetnly the datasheet file size is too large to upload, so here is a link. https://www.google.com/url?sa=t&rct=j&q ... 5_RWBJCBDw
Thanks
Yes, its looks to be the analogue input! How/Why is the analogue input affecting the IOC though when the analogue input is is the main program? Will the anlalogue input (RC4/AN20) still affect the IOC on RC2 just because its on the same port?
I am guessing I need to change RC2 to a general IO and not an analogue input to resolve this problem? I have had a look into the datasheet and I cant seem to find the right register to make the change. Apparetnly the datasheet file size is too large to upload, so here is a link. https://www.google.com/url?sa=t&rct=j&q ... 5_RWBJCBDw
Thanks
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
Re: IOC dilema
Sorry to push
I have shown the ADC is the affecting the IOC, so how to I stop it from doing it?
Thanks
I have shown the ADC is the affecting the IOC, so how to I stop it from doing it?
Thanks
- 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: IOC dilema
Hello,
Not sure how to help any further. I would probably need to see your project to offer any further advise. You can send via a PM if you do not want it to be made public. Ideally you can strip the file back to the basics that show the problem then this would be very helpful in terms of making sure we see the wood for the trees.
Not sure how to help any further. I would probably need to see your project to offer any further advise. You can send via a PM if you do not want it to be made public. Ideally you can strip the file back to the basics that show the problem then this would be very helpful in terms of making sure we see the wood for the trees.
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
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
Re: IOC dilema
Thanks Ben
I have stripped the program back to bare basics, I now no longer even have the input pulse but still getting a strange output. FC program is attached and the output is below.
Thanks
I have stripped the program back to bare basics, I now no longer even have the input pulse but still getting a strange output. FC program is attached and the output is below.
Thanks
- Attachments
-
- IOC ADC Issue.fcfx
- (15.82 KiB) Downloaded 214 times
- 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: IOC dilema
Hello,
If you add a delay into the loop then does this change anything in terms of wierdness? Just looking at the CAL code for the ADC (pin C4 - ADC20) and it all seems to check out.
To sum up your various connections.
You have interrupt on pin C2.
C1 is an analogue input - InputVoltage
C3 is an analogue input - Current
C4 is an analogue input - POT
C6 is an analogue input - Analogue
PWM and PowerOut are both PWM components that are assigned to different pins but both use the same PWM channel.
Have you looked at the errata document for the chip on the Microchip website to see if it is a known silicon bug?
If you add a delay into the loop then does this change anything in terms of wierdness? Just looking at the CAL code for the ADC (pin C4 - ADC20) and it all seems to check out.
To sum up your various connections.
You have interrupt on pin C2.
C1 is an analogue input - InputVoltage
C3 is an analogue input - Current
C4 is an analogue input - POT
C6 is an analogue input - Analogue
PWM and PowerOut are both PWM components that are assigned to different pins but both use the same PWM channel.
Have you looked at the errata document for the chip on the Microchip website to see if it is a known silicon bug?
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
- 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: IOC dilema
Hi.
I haven't studied your device datasheet but recall had a similar situation make sure if the pins you are using is also connected to the comparators
make sure you switch the comparators OFF
I haven't studied your device datasheet but recall had a similar situation make sure if the pins you are using is also connected to the comparators
make sure you switch the comparators OFF
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR