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.

Problems with PIC 18F4620 program in CCS C Compiler

Status
Not open for further replies.

brn.caldeira

Newbie level 1
Joined
Jul 14, 2008
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Brazil - MG - SRS
Activity points
1,291
Hello,

I´m starting programming in C and I have a problem with my code.When I press a key in PC the program points to the begin and does not recognize the characters written.I´m using CCS C Compiler.

#include <18F4620.H> // arquivo de definições do microcontrolador usado
#use delay(clock=10000000) // informa ao sistema o frequência de clock, para temporização
#use rs232(baud=9600,parity=N,xmit=pin_c6,rcv=pin_c7)
#fuses HS,NOFCMEN,NOIESO,PUT,BROWNOUT,BORV43,NOWDT,CCP2C1,NOPBADEN,MCLR,STVREN,NOLVP,NOXINST, NODEBUG, PROTECT,CPB,NOCPD,NOWRT,WRTC,WRTB,NOWRTD,NOEBTR,NOEBTRB

#bit TX_TTL = PORTC.6 // 0 reservado Out
#bit RX_TTL = PORTC.7 // 0 reservado Out

// *** Rotina Principal
void main(void){
unsigned char caract;
int data;

printf("working");

for (;;){
switch(getc()){
case '1': printf("potência");
break;
case '2' : printf("temperatura");
break;

}
}
}


someone help me?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top