mikroC code problems

Status
Not open for further replies.

noor007

Newbie level 4
Joined
Mar 16, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,327
unsigned spd,dirc,temp ;
unsigned st=0 ;

// OUTPUT

#define S_ON PORTA.F0 //
#define D_OUT PORTA.F1 //
#define SPD_1 PORTA.F2 //
#define SPD_2 PORTC.F0 //
#define SPD_3 PORTC.F1 //
#define STATUS PORTC.F4 //
#define BREAK PORTC.F5 //

// INPUT

#define S_RUN PORTA.F3 //
#define D_IN PORTC.F2 //
#define ALRM PORTA.F5 //
#define S_RDY PORTA.F4 //
#define SPD PORTC.F3 //


void main() {

CMCON =0 ; //COMPATATOR OFF
ANSEL =0b11000000 ; //
ADCON0.VCFG =0 ; // Vdd as Vref
INTCON =0 ; // disable all interrupts

TRISA = 0b00111000 ; //
TRISC = 0b00001100 ;

PORTA=0 ;
PORTC=0 ;


//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

//test

S_ON =1 ;
Delay_ms(1000) ;
SPD_1 =1 ;
Delay_ms(1000) ;
D_OUT=1 ;
Delay_ms(1000) ; //
SPD_2 =1 ;
Delay_ms(1000) ; //
SPD_3 =1 ;
Delay_ms(1000) ; //
STATUS =1 ;
Delay_ms(1000) ; //
BREAK =1 ;
Delay_ms(1000) ; //

do {}while(1);

}

hi,
my problem is S_ON is not stable,when D_OUT is turn on ,S_ON is automatically turn off .my another part is OK .my MCU pic1f675.it is written at mikroC 8.

please help some one.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…