CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Problem with the uart PIC 24FJ128GA006

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
frankcr



Joined: 29 Apr 2010
Posts: 11

View user's profile Send private message MSN Messenger

Problem with the uart PIC 24FJ128GA006
PostPosted: Fri May 28, 2010 10:16 pm     Reply with quote

Hello I use the uart in the PIC24FJ128GA006, but I have this problem:
Quote:

"Undefined identifier PIC_C1"
"Undefined identifier PIC_C2"

This is part of my code:
Code:

.....
#use rs232(UART1,baud=9600,parity=N,bits=8)
...
#define CTS PIN_C1 //Clear to send
#define RTS PIN_C2 //Request to send
.....
// ********** INICIALIZA HOST USB ***************************
void inic_host()  {

   output_high(RTS);
   while(input(CTS));     //espero que el VDRIVE2 busque el pic
   output_low(RTS);       //le envio una respuesta
   
  serial_sendbyte('S'); //envĂ­a un SCS (habilitar comandos en modo corto)
   serial_sendbyte('C');
   serial_sendbyte('S');
   serial_sendbyte(0x0D);  //caracter para indicar fin del comando(enter)

}
//**************************************************

//***ENVIA UN CARACTER AL PUERTO SERIE ***********************

void serial_sendbyte(unsigned int8 TXbyte){ //ENVIAR UN CARACTER
   
      while(input(CTS));
      putc(TXbyte);
     
}

I have PCD 4.104. Can anyone help me?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat May 29, 2010 12:22 am     Reply with quote

The said chip has no C1 or C2 pin. They are only present with larger package types. Check the datasheet or CCS device file.
frankcr



Joined: 29 Apr 2010
Posts: 11

View user's profile Send private message MSN Messenger

PostPosted: Sat May 29, 2010 12:04 pm     Reply with quote

Thanks I saw my error, after I posted the problem.
I have other question: I need to especify the RX and TX pins?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun May 30, 2010 3:35 am     Reply with quote

PIC24FJ128GA006 has fixed UART pins. Specifying UART1 or UART2 in the #use rs232 statement is sufficient.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group