Welcome to the E-blocks forum

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

JUZAR
Posts: 30
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 13 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Postby JUZAR » Sat May 07, 2016 4:05 am

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
Attachments
16F684config.pdf
(329.68 KiB) Downloaded 581 times

JUZAR
Posts: 30
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 13 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Postby JUZAR » Sat May 07, 2016 6:23 am

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.
Attachments
compiler optn.pdf
(272.04 KiB) Downloaded 609 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8420
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2405 times
Been thanked: 3437 times
Contact:

Re: Welcome to the E-blocks forum

Postby medelec35 » Sat May 07, 2016 12:42 pm

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
These users thanked the author medelec35 for the post:
JUZAR (Mon May 09, 2016 10:00 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JUZAR
Posts: 30
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 13 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Postby JUZAR » Mon May 09, 2016 10:00 am

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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8420
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2405 times
Been thanked: 3437 times
Contact:

Re: Welcome to the E-blocks forum

Postby medelec35 » Mon May 09, 2016 10:30 am

Hi Juzar,
You're welcome.
Glad PWM is now working for you.
Thanks for the update.

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JUZAR
Posts: 30
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 13 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Postby JUZAR » Mon May 09, 2016 12:33 pm

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
Attachments
zerocrossdemo.fcfx
(6.92 KiB) Downloaded 429 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8420
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2405 times
Been thanked: 3437 times
Contact:

Re: Welcome to the E-blocks forum

Postby medelec35 » Sat May 14, 2016 2:52 pm

Hi Juzar,
Sorry for late reply.
Have you got any further or do you still require help?
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

JUZAR
Posts: 30
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 13 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Postby JUZAR » Wed May 18, 2016 10:39 am

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.
Attachments
zerocrossdemo1.fcfx
(6.84 KiB) Downloaded 391 times