Page 2 of 2

Re: Welcome to the E-blocks forum

Posted: Sat May 07, 2016 4:05 am
by JUZAR
Hi Martin.

As suggested by you, changed the setting in config, prepared a HEX file and programmed on chip, but no output. Port C.5 is showing LOW on oscilloscope. Please see attached config screen shot.

Regards.

Juzar

Re: Welcome to the E-blocks forum

Posted: Sat May 07, 2016 6:23 am
by JUZAR
Hi Martin,

Kindly see attached compiler options screen shot. Its showing PICKIT2 as default, please check whether it is creating any issue while programming the chip on E-block-006V9.

Regards

Juzar.

Re: Welcome to the E-blocks forum

Posted: Sat May 07, 2016 12:42 pm
by medelec35
Hi JUZAR,
There is a bug within PIC_CAL_PWM.c that appears to be affecting PWM with various target devices, yours included.
Can you take a look at this post please.
Once you have replaced the PIC_CAL_PWM.c file then all should be working as normal.

Martin

Re: Welcome to the E-blocks forum

Posted: Mon May 09, 2016 10:00 am
by JUZAR
Hi Martin.

Copied the PIC_CAL_PWM.c and tested the software on PIC16F684, its now working. Further tried on PIC16F1824 and it worked well.

Kindly ignore my previous message dated May 15, 2016 along with attachment, because even that software is now running properly.

Thanks for your support.

Regards.

Juzar.

Re: Welcome to the E-blocks forum

Posted: Mon May 09, 2016 10:30 am
by medelec35
Hi Juzar,
You're welcome.
Glad PWM is now working for you.
Thanks for the update.

Martin

Re: Welcome to the E-blocks forum

Posted: Mon May 09, 2016 12:33 pm
by JUZAR
Hi Martin.

After getting PWM successful, a further step in flow code was to write a flowcode for zero cross detector. I am facing problem as under.

1) Input Frequency range 20 Hz to 60 Hz, square wave from opto isolator.
2) Enabled Interrupt routing using INT pin in PIC16F1824. square input was given to INT Pin No. 11 on port A2.
3) In macro routing PWM was enabled to generate 800 micro second pulse and than PWM was disabled.
4) I have used a push button to detect the rising edge. So on simulation the PWM is giving output when ever push button is pressed. But on actual circuit it is not working.
5) Attached flowcode file.

Now the problem is there is no output pulses at rising edge of input frequency. Kindly check whether the flowcode routing is correct or there is any issue which is restricting INT pin to detect input frequency. Also would like to share with you that the opto isolator used is slow type so the rising and falling edges of input frequency has approximately 1 ms delay from 0 V to 5 V.

Awaiting your reply at the earliest.

Regards

Juzar

Re: Welcome to the E-blocks forum

Posted: Sat May 14, 2016 2:52 pm
by medelec35
Hi Juzar,
Sorry for late reply.
Have you got any further or do you still require help?

Re: Welcome to the E-blocks forum

Posted: Wed May 18, 2016 10:39 am
by JUZAR
Dear Martin.

Yes, I need your support. Since I was not successful with INT pin, so I made a zero cross detector using straight forward routine as per attachment. Its working perfectly fine, but problem is, it will be required to continuously monitor in main routine both rising and falling edges so that no pulses are missed. I tried by using INT pin of PIC16F1824 but no output or it was giving random or missing pulses. Kindly guide me how to use INT pin to generate accurate filtered zero crossing pulse from 20 Hz to 60 Hz.

In the attached flowcode, once rising edge is detected a 1 ms zero crossing detector pulse is generated. In order to filter out noise, I have read the ADC Average byte, so please advise whether it will help in filtering the noise.

Presently I am writing flowcodes for individual requirement, which will be further combined to finish entire project. Therefore my intention is to minimize use of main routine and give responsibility to timers & interrupts where ever applicable.

Awaiting your reply at the earliest.

Regards.

Juzar.