Hi folks, for some inexplicable reason, all four of my through hole 14M2 chips are having some anomalous behavior executing some simple code to control a Yellow/Blue bi-colored common anode LED. Here is the snippet of code they're having trouble executing correctly. I should also add the fact that this is not new code, I have been using it for years with no problems until now. I also have this same code written for the 20M2 that is still working just fine.
Pin C.0 controls the yellow LED and C.2 controls the blue LED. It's Case 3 that is having the problem. The blue LED is supposed fade out, but it does not fade out, it goes out all at once, as if I had switched off the power. As far as I can tell, that code is the correct instructions to make the LED fade out when I press the momentary switch for the third time. (i.e "Case 3"). I removed the 14M2 from the breadboard and replaced it with a 20M2, then changed the outputs for the 20M2 code from C.0 and C.2 to C.2 (Yellow) and C.3 (blue) and it fades out just like it's supposed to. Here is the Case 3 snippet from the 20M2 code
As you can see, there's no difference in the instructions. Anyone have any ideas as to what's going on here? I've tried reprogramming them, also tried erasing them, then reprogramming them. Two of the 14M2s are brand new, never having been programmed with any other code.
Code:
; ====== Deflector Dish CTRL ========================
Start1:
Do
Suspend 1
buttonA = buttonA + 1
Select Case buttonA
Case 1
PwmOut PWMDIV4, C.0, 99, 0
For pwmA = 0 To 400
PwmDuty C.0, pwmA
Pause 2
Next
Case 2
PwmOut PWMDIV4, C.2, 99, 0
For pwmA = 0 To 400
PwmDuty C.2, pwmA
Pause 2
Next
For pwmA = 400 To 0 Step -1
PwmDuty C.0, pwmA
Pause 2
Next
PwmOut C.0, off
Case 3
For pwmA = 400 To 0 Step -1
PwmDuty C.2, pwmA
Pause 2
Next
PwmOut C.2, off
buttonA = 0
End Select
Loop
Pin C.0 controls the yellow LED and C.2 controls the blue LED. It's Case 3 that is having the problem. The blue LED is supposed fade out, but it does not fade out, it goes out all at once, as if I had switched off the power. As far as I can tell, that code is the correct instructions to make the LED fade out when I press the momentary switch for the third time. (i.e "Case 3"). I removed the 14M2 from the breadboard and replaced it with a 20M2, then changed the outputs for the 20M2 code from C.0 and C.2 to C.2 (Yellow) and C.3 (blue) and it fades out just like it's supposed to. Here is the Case 3 snippet from the 20M2 code
Code:
Case 3
For pwmA = 400 To 0 Step -1
PwmDuty C.3, pwmA
Pause 2
Next
PwmOut C.3, off
buttonA = 0
End Select
Loop
As you can see, there's no difference in the instructions. Anyone have any ideas as to what's going on here? I've tried reprogramming them, also tried erasing them, then reprogramming them. Two of the 14M2s are brand new, never having been programmed with any other code.
Last edited: