I have a pic project that I was attempting to add a TM1637. It wan't working and I ended up putting the scope on the clock and data lines. The clock line had additional clocks than it should have had. As I had various other bits of code and after much head scratching, I started a new project with just the following code,
This is what I see on the scope.
The timebase is 50uS.
If the delay is shorted to 50uS I see this,
I started with a 16F18346 and then changed to a 16F18446 but it made no difference.
I've powered it from PK4 and a separate power supply - no difference.
WDT is off.
The scope has a 1kHz output which it shows as a perfect square wave.
Anyone any ideas what might cause this?
I'm hoping I've done something really stupid so I can get on with this.
Mike.
Code:
#include <xc.h>
#include <stdint.h>
#define _XTAL_FREQ 32000000
void main(void){
ANSELB=0;
OSCCON1 = 0x60; //HF int osc
OSCFRQ = 0x07; //32MHz clock
BORCON = 0x00;
LATB4=1;
TRISB4=0;
LATB4=0;
__delay_us(250);
LATB4=1;
while(1);
}
The timebase is 50uS.
If the delay is shorted to 50uS I see this,
I started with a 16F18346 and then changed to a 16F18446 but it made no difference.
I've powered it from PK4 and a separate power supply - no difference.
WDT is off.
The scope has a 1kHz output which it shows as a perfect square wave.
Anyone any ideas what might cause this?
I'm hoping I've done something really stupid so I can get on with this.
Mike.