PWM Timing Clarification
Posted: Wed Nov 04, 2015 12:51 am
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
.