I have a piece of code that toggles the GP2 pin on a PIC12F615 and suddenly it started producing a weird waveform, I'm not sure what I've done that could cause this. I isolated the code that toggles the pin alone in a new project to see if I'm doing something wrong but I still get the same result.
Here's the waveform:
void main(void)
{
__delay_ms(10);
TRISAbits.TRISA2 = 0;
while(1)
{
PORTAbits.GP2 = 0;
__delay_us(55);
PORTAbits.GP2 = 1;
__delay_us(55);
}
return;
}
Answer
It looks like the transistor that sinks (NMOS) is broken. Because it's not happening, the capacitance is discharging through the probe by the looks of it.
But the pin is still usable if you just use a pull down resistor on that pin. Say 2k ohm resistor tied to ground.
No comments:
Post a Comment