Strange Reset Problem

Started by Soumya Chatterjee February 6, 2009
Hii.. EveryBody

I have a strange problem.... I have wrote a simple code

void main()
{
      TRISB = 0 ;
      PORTB = 0 ;

      DELAY_MS( 2000 ) ;

      PORTB = 255 ;

      DELAY_MS( 2000);

      while(1)
      {

          PORTB = 0xF0 ;
      }

}

So everytime O/p Of PORTB will 0XF0. Only when a reset will occur all the LEDs connected with PORTB will Glow.

But when I  Power Up the System the system resets in a regular fashon. In Configuration word Watch Dog Timer is Disabled. Brown Out Detect is also Disable. I am using code word as 0x3F39.

In reset pin 10K,10 uF is connected. I am taking the Vcc from a 7805. AC ripple present is 0.2 mV. particulary when I switch on some other equipments connected with the AC Line like tubelight,CRO,Variac either during switch on period or during switch off period Microcontroller resets.

I am using 4 Mhz with 15 PF capacitors. 470 uf is connected in the o/p of 7805.

But if brown out reset is disabaled then what could cause the problem??

Thanks in advance

Soumya

  With Thanks and Regards Soumya Chatterjee Mobile: 9007282980  Gravitation is not responsible for people falling in love. - Albert Einstein
Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
Hi my friend,

Two stuff, what Pic are you using, and do you using one resistors in
each I/O of the port B connected to the leds?? Sometimes the pic can
not drive all the port because the courrent source is to small...!!

Remember too if you using one pic with interrupts on Portb you must
desactivate this because if one interrupt occur and you dont have the
IRQ routine the pic must be in the reset point.

But never forgot your iniciative routine to configurate all the pic
and the ports, so is important to know what kind of pic are you using
for this project.

And them try with this...

void main()
{
TRISB = 0 ;
PORTB = 0 ;
while(1)
{
DELAY_MS( 2000 ) ;
PORTB = 255 ;
DELAY_MS( 2000);
PORTB = 0 ;
}
}
Whe are in touch from Venezuela... Bye..!!
--- In p..., Soumya Chatterjee
wrote:
>
> Hii.. EveryBody
>
> I have a strange problem.... I have wrote a simple code
>
> void main()
> {
>       TRISB = 0 ;
>       PORTB = 0 ;
>
>       DELAY_MS( 2000 ) ;
>
>       PORTB = 255 ;
>
>       DELAY_MS( 2000);
>
>       while(1)
>       {
>
>           PORTB = 0xF0 ;
>       }
>
> }
>
> So everytime O/p Of PORTB will 0XF0. Only when a reset will occur
all the LEDs connected with PORTB will Glow.
>
> But when I  Power Up the System the system resets in a regular
fashon. In Configuration word Watch Dog Timer is Disabled. Brown Out
Detect is also Disable. I am using code word as 0x3F39.
>
> In reset pin 10K,10 uF is connected. I am taking the Vcc from a
7805. AC ripple present is 0.2 mV. particulary when I switch on some
other equipments connected with the AC Line like tubelight,CRO,Variac
either during switch on period or during switch off period
Microcontroller resets.
>
> I am using 4 Mhz with 15 PF capacitors. 470 uf is connected in the
o/p of 7805.
>
> But if brown out reset is disabaled then what could cause the
problem??
>
> Thanks in advance
>
> Soumya
>
>
>
>   With Thanks and Regards Soumya Chatterjee Mobile:
9007282980  Gravitation is not responsible for people falling
in love. - Albert Einstein
>
>
> Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/
>



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
Hi Soumya!
I had a similar problem when driving a small motor with a small relay; every time I connected the motor; my PIC was reseting. When I tested the PIC separatedly from the motor; everything was fine; as long as I connected the motor the problems started. I even wrote a similar routine to yours in assembler, to know if the PIC was reseting. What I found was that my prototype (that was hand wired and soldered), had ground problems (same ground for motor and PIC in the same wire). The cure was to separate grounds (power ground and signal ground). I think your problem is on ground or Vdd; try to add a 0.1 Mf cap between Vdd and Vss (beside the cap you already have); the closest possible to the PIC chip.
I hope this can be helpful to you.
--- In p..., Soumya Chatterjee wrote:
>
> Hii.. EveryBody
>
> I have a strange problem.... I have wrote a simple code
>
> void main()
> {
>       TRISB = 0 ;
>       PORTB = 0 ;
>
>       DELAY_MS( 2000 ) ;
>
>       PORTB = 255 ;
>
>       DELAY_MS( 2000);
>
>       while(1)
>       {
>
>           PORTB = 0xF0 ;
>       }
>
> }
>
> So everytime O/p Of PORTB will 0XF0. Only when a reset will occur all the LEDs connected with PORTB will Glow.
>
> But when I  Power Up the System the system resets in a regular fashon. In Configuration word Watch Dog Timer is Disabled. Brown Out Detect is also Disable. I am using code word as 0x3F39.
>
> In reset pin 10K,10 uF is connected. I am taking the Vcc from a 7805. AC ripple present is 0.2 mV. particulary when I switch on some other equipments connected with the AC Line like tubelight,CRO,Variac either during switch on period or during switch off period Microcontroller resets.
>
> I am using 4 Mhz with 15 PF capacitors. 470 uf is connected in the o/p of 7805.
>
> But if brown out reset is disabaled then what could cause the problem??
>
> Thanks in advance
>
> Soumya
>
>
>
>   With Thanks and Regards Soumya Chatterjee Mobile: 9007282980  Gravitation is not responsible for people falling in love. - Albert Einstein
>
>
> Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
>



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions