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 CCS Technical Support

RF Module via RS-232 Help & suggestion.

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



Joined: 24 Jul 2005
Posts: 13

View user's profile Send private message

RF Module via RS-232 Help & suggestion.
PostPosted: Thu Oct 06, 2005 2:46 am     Reply with quote

Code:

//This routine tries to get the status of the Aerocomm module.
//The UART of PIC is set to the AC4424's default baud rate of 115200bps


int1 _AC4424_stat(int8 mode){
char cmd[3]; int i;

//Now we initialize the array for the command.

cmd[0] = 0xCC;     
cmd[1] = 0x00;
cmd[2] = 0x00;

// Delay for a second just to make sure that the transmit buffer is empty.
  delay_ms(1000);

// Bring down the Command/Data pin to LOW
  output_low(_4424_CMDDAT);

// Clear CTS.
  while( input(_4424_CTS));

// Disable RTS.
  output_low(_4424_RTS);
 
  delay_us(100);

    printf(out_soft_uart,"CMD_S0");  // This is debug code;

//Sending the command
     for (i=0; i<=2; i++){
      out_uart(cmd[i]);
     }

//Waiting for the reply.

     while(!kbhit(RAD24)); // the wait never ends. The UART is fully functional. Nothing is

//returned by the AC4424 but it continues to receive data without fail.

// If it gets a reply, print it out.
     while(kbhit(RAD24))   printf(out_soft_uart,"%d",(fgetc(RAD24)));
     delay_ms(100);

     printf(out_soft_uart,"\tREP\t"); // THIS is debug code.

// Pull the command/data pin high, thereby exiting the command mode.

      output_high(_4424_CMDDAT);

        return(TRUE);
}




The problem is with configuring the AC4424 module. Seems like AC4424 never heard my commands. The data-sheet here never specifies anything in particular.

Any help or suggestions are welcome.
_________________
-cstan
.................................................
Your Mind Is Your Biggest Asset !!
.................................................
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE
PostPosted: Thu Oct 06, 2005 10:28 pm     Reply with quote

Hi,

Is the PIC configured for 115200 baud, is it possible to settle for a lower speed like 9600 baud. ??

Also ensure the data is being sent from the PIC.

thanks
arunb
cstan_02



Joined: 24 Jul 2005
Posts: 13

View user's profile Send private message

RF Module via RS-232 Help & suggestion.
PostPosted: Fri Oct 07, 2005 6:53 am     Reply with quote

Hello arun,
Thanks for your input. But I'm using the harware uart and I don't think the baud rate should be a problem. Anyway I suspect some harware problems, as i cannot see anything in software. Have done wireless projects before ??

Thanks.
_________________
-cstan
.................................................
Your Mind Is Your Biggest Asset !!
.................................................
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Fri Oct 07, 2005 8:27 am     Reply with quote

Hi cstan_02,

Not exactly...But you need to setup the baud rate in the PIC .

thanks
arunb
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Oct 07, 2005 8:58 am     Reply with quote

As @arunb told you, first try to comunicate at 9600 Bauds.

Quote:


The problem is with configuring the AC4424 module. Seems like AC4424 never heard my commands. The data-sheet here never specifies anything in particular.



You will get the User Manual here:

http://www.aerocomm.com/Docs/User_Manual_AC4424.pdf

and if you read in Page 24:

5.1.5 9600 Baud/Packet Frame (Pin 12)9600_BAUD -
When pulled logic Low before applying power or resetting the transceiverīs
serial interface is forced to a 9600, 8-N-1 rate.


Also be aware that in the Hardware Interface description (Page 23) says:

The AC4424 accepts 5V TTL level in the RXD pin.


Humberto
cstan_02



Joined: 24 Jul 2005
Posts: 13

View user's profile Send private message

RF Module via RS-232 Help & suggestion.
PostPosted: Fri Oct 07, 2005 7:53 pm     Reply with quote

Many thanks to arun and humberto. But I found out my problem's with some uart routines. The Aercomm user manual says that there should not be any delays when sending command characters while in command mode.

Thanks.
_________________
-cstan
.................................................
Your Mind Is Your Biggest Asset !!
.................................................
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