PIC Dieing?

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

PIC Dieing?

Postby wjwong » Wed Feb 29, 2012 12:38 pm

I try run simple program as below:
#include <pic.h>
__CONFIG ( 0x3F32 );

void main(void)
{
while(1)
{
TRISC=0b00000000;
PORTC=0b11111111;
}
}

but when i measure portC output has no voltage~~

I am using cytron sk40c, any countermeasure?
wjwong
Novice
 
Posts: 19
Joined: Sat Oct 29, 2011 9:35 pm

Re: PIC Dieing?

Postby wjwong » Wed Feb 29, 2012 12:52 pm

Even changing new PIC16f887~~ Got any similarly case? i expecting PIC is sleeping, oscillation problem?
wjwong
Novice
 
Posts: 19
Joined: Sat Oct 29, 2011 9:35 pm

Re: PIC Dying?

Postby ABSF » Wed Feb 29, 2012 3:27 pm

I dont see why this is a big problem. In the 8051, you dont need to set the PORT Direction Registers and there is no PDR in 8051. When you write to the port, it automatically becomes output and when you read the port, it becomes input.

If you put the TRISC=0 outside the while(1) loop then the program works normally.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 6 guests