Problema con macro y pic 16F1829

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Carmelo
Posts: 132
http://meble-kuchenne.info.pl
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 53 times
Been thanked: 4 times

Problema con macro y pic 16F1829

Post by Carmelo »

I have a pcb and a program made with the pic 16F688 working correctly. Attached file.

Now I need to make a modification to the project and I have to change the pic model to the 16F1829. To do this I change the target model and adjust the configuration bits appropriately so that it works with an internal oscillator at 8MHz as with the 16F688. I also attach the file.

The pcb board remains the same.

The program must detect when 10 pulses occur at the input and at that moment an output is activated for a certain time. After this time, the output must return to 0. But during that time, if any more pulses occur at the input it must continue counting them.

The fact is that with the pic16F1829, being the same program, it does not work. So the pulses are counted correctly, the output is activated, but it never deactivates.

I have tested disabling the macro to read the pulses within the output activation time cycle (capture attached) and in this case the output is deactivated when the programmed time elapses. But of course, if any more pulses occur during the output activation time, the pulse is not counted and it needs to be able to be counted.

I don't understand why it doesn't work when the macro to read the pulses is activated using the pic 16F1829 and it does work with the 16F688, the program being exactly the same.

Can someone tell me why this could be happening?

P.S.: It doesn't work on the physical model pcb, but it is working in the simulation. Could it be a bad configuration of the internal oscillator frequency?

I have another project with the same pic 16F1829 and the same oscillator configuration and it works very well.

Thank you very much
Attachments
CONTADOR_10_PULSOS_16F1829.fcfx
(18.13 KiB) Downloaded 152 times
CONTADOR_10_PULSOS_16F688.fcfx
(18.09 KiB) Downloaded 124 times
Macro deshabilitada.png
Macro deshabilitada.png (63.24 KiB) Viewed 1745 times

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: Problema con macro y pic 16F1829

Post by mnfisher »

I would look at using at interrupt to count the pulses. Less chance of missing one..

Martin

Post Reply