Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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.
 

Which processor are you using? There is no such device as 16F675 and if it's a 12F675 it doesn't have a PORTC.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top