Ram Prasadh
Member level 2
Hi
I have Presently started working on a device which will be useful for Power Measurement. I am using a PIC16F72 Controller with a MAX3180. I use a 4 Mhz Oscillator for the PIC. I wrote a code to just toggle the bits of port b in the PIC , but when I burn the hex code ,it is not even making any changes in the port. I am attaching that code here. I have a doubt on the operation of the Oscillator.Please give me some suggestion on where the problem could be?
#include<pic16f72.h>
typedef unsigned int word;
word at 0x2007 CONFIG = _HS_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_ON;
void delay()
{
unsigned int z;
for(z=0;z<250;z++);
}
void main(void)
{
TRISB=0;
for(;
{
while(1)
{
PORTB=0X00;
delay();
PORTB=0XFF;
delay();
}
}
}
I have Presently started working on a device which will be useful for Power Measurement. I am using a PIC16F72 Controller with a MAX3180. I use a 4 Mhz Oscillator for the PIC. I wrote a code to just toggle the bits of port b in the PIC , but when I burn the hex code ,it is not even making any changes in the port. I am attaching that code here. I have a doubt on the operation of the Oscillator.Please give me some suggestion on where the problem could be?
#include<pic16f72.h>
typedef unsigned int word;
word at 0x2007 CONFIG = _HS_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_ON;
void delay()
{
unsigned int z;
for(z=0;z<250;z++);
}
void main(void)
{
TRISB=0;
for(;
{
while(1)
{
PORTB=0X00;
delay();
PORTB=0XFF;
delay();
}
}
}