joliebrise
New Member
Very odd situation.
The following code works but the fist sub code "beat50" reduces the speaker volume
Question:
Why should the position of the first sub code “beat50” cause the sound output from the speaker to be significantly reduced.
INIT:
dirsb=%01000000
dirsc=%00000000
main:
if pinb.7 = 1 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat25
if pinb.7 = 0 and pinb.6 = 1 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat30
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 1 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat35
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 1 and pinb.3 = 0 and pinb.2 = 0 then beat40
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 1 and pinb.2 = 0 then beat45
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 1 then beat50
beat50: : high c.5 : sound b.1, (50,50) : pause 4592 : low c.5 : goto main
beat45: : high c.4 : sound b.1, (50,50) : pause 4060 : low c.4 : goto main
beat40: : high c.3 : sound b.1, (50,50) : pause 3554 : low c.3 : goto main
beat35: : high c.2 : sound b.1, (50,50) : pause 3080 : low c.2 : goto main
beat30: : high c.1 : sound b.1, (50,50) : pause 2563 : low c.1 : goto main
beat25: : high c.0 : sound b.1, (50,50) : pause 2106 : low c.0 : goto main
The metronome was tested without Leds and worked correctly with even sound levels for all switch positions
The next stage was to add matching leds and this is where the problems started. The sound output at the first switch position was greatly diminished and other positions reduced the sound. I changed the chip and remade the breadboard.
Tested voltage across C pins and ground. C.0 – Beat 25 = 3.18v
Others were 3.95, 4.12, 4.06, 4.07, 4.09 At c.5
It struck me that the problem could be caused by the order of the sub codes. I tested various orders of the six codes with the number referring to the pulse delay;
beat25, 30, 35, 40, 45, 50 = 2.5sec, 3.0, 3.5, 4.0, 4.5 and 5.0sec
I even reversed the order of the switch input wires.
Full details
The following code works but the fist sub code "beat50" reduces the speaker volume
Question:
Why should the position of the first sub code “beat50” cause the sound output from the speaker to be significantly reduced.
INIT:
dirsb=%01000000
dirsc=%00000000
main:
if pinb.7 = 1 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat25
if pinb.7 = 0 and pinb.6 = 1 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat30
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 1 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 0 then beat35
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 1 and pinb.3 = 0 and pinb.2 = 0 then beat40
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 1 and pinb.2 = 0 then beat45
if pinb.7 = 0 and pinb.6 = 0 and pinb.5 = 0 and pinb.4 = 0 and pinb.3 = 0 and pinb.2 = 1 then beat50
beat50: : high c.5 : sound b.1, (50,50) : pause 4592 : low c.5 : goto main
beat45: : high c.4 : sound b.1, (50,50) : pause 4060 : low c.4 : goto main
beat40: : high c.3 : sound b.1, (50,50) : pause 3554 : low c.3 : goto main
beat35: : high c.2 : sound b.1, (50,50) : pause 3080 : low c.2 : goto main
beat30: : high c.1 : sound b.1, (50,50) : pause 2563 : low c.1 : goto main
beat25: : high c.0 : sound b.1, (50,50) : pause 2106 : low c.0 : goto main
The metronome was tested without Leds and worked correctly with even sound levels for all switch positions
The next stage was to add matching leds and this is where the problems started. The sound output at the first switch position was greatly diminished and other positions reduced the sound. I changed the chip and remade the breadboard.
Tested voltage across C pins and ground. C.0 – Beat 25 = 3.18v
Others were 3.95, 4.12, 4.06, 4.07, 4.09 At c.5
It struck me that the problem could be caused by the order of the sub codes. I tested various orders of the six codes with the number referring to the pulse delay;
beat25, 30, 35, 40, 45, 50 = 2.5sec, 3.0, 3.5, 4.0, 4.5 and 5.0sec
I even reversed the order of the switch input wires.
Full details
Attachments
-
135.5 KB Views: 35