PWM Timing Clarification

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times
Contact:

PWM Timing Clarification

Post by christoph »

DIL Sounder Sweep output 12F1840 V2.fcf
(10.5 KiB) Downloaded 848 times
Hi Martin and others,

This is a follow on of an earlier post in General Programming where I was asking whether it would be possible to extract a flowcode programme from a chip to produce the flowchart again. I know its out omy capabilities now!!

With regard to the attached flowchart which Martin posted for me some time ago to produce the sound capability for the hardware I had designed to drive a piezo sounder, the situation is:-
a) At that time I put all components on a breadboard and programmed the chip using Martins flowchart - which workwd fine and gave the required 'waa waa' sound I was after.

b) Recently I put it all on a PCB using the same programme and it is working but not quite correctly.

c) With the correctly working one, a series of 16 tones go up and down the scale at a speed which can be slowed right down so each note can have a duration of a second or more or speeded up to the point where the sound sweeps smoothly up and down with no noticeable 'steps', producing the 'waa waa' sound.

d) In the case of the PCB set up, all the components are exactly the same values etc. except for the chip but very basically there appears to be a fixed 2 seconds time limit so that if one sets it at slow speed, it only does a few tones before the 2 second limit and it starts again and each time it reaches the 2 seconds it 'clicks'. In fact it can be set slow enough to just cycle two notes continuously. If set at fastest speed, it does sound like the 'waa waa' but at every two second point it returns abruptly to zero and the lowest note of the scale with a click and it is out of sync with the sweep so it is noticeable.

e) I know it is something simple and probably related to the fact that the working breadboarded set up is using a PIC12F1840 DIL chip and the PCB arrangement set up also uses the same chip but in a SMD '8-DFN' package, however, I am not clever enough to spot the significant difference which may require a tweak to the flowchart.

It would be great to get this problem solved but although I have tried, I havent found a solution.
Best regards,
Chris
.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: PWM Timing Clarification

Post by kersing »

Hi Chris,

Do you have hardware design you can post?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PWM Timing Clarification

Post by medelec35 »

Hi Chris ,
Not had a chance to try on hardware, so just as a pure guess.
Can you go to configuration settings and change In-Circuit Debugging Mode from Enabled to Disabled.
It may or may not work.
If it does not then I could look further in to this when I get home.

Martin
Martin

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times
Contact:

Re: PWM Timing Clarification

Post by christoph »

Hi fellars,
I didnt think anyone would be around last night! so I shut down after posting and missed your post kersing and as I didnt get a chance to check until a short time ago, I saw yours and Martins post at the same time so having disabled the de-bugging, it works a treat and exactly the same as the breadboarded DIL one. Very much appreciated Martin and I hope that has freed up a bit of your evening now!!
Thanks to you too kersing - I always appreciate the interest people have in coming to the rescue when I (or others) have not been able to solve a problem.
Many thanks Martin
Best regards
Chris

Post Reply