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

24fj16ga002 irda enable

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







24fj16ga002 irda enable
PostPosted: Thu Mar 26, 2009 1:43 pm     Reply with quote

Hi all,

I am using pic24fj16ga002 for my project and I want to use irda encoder and decoder option. My code is:
Code:
#include <24FJ16GA002.h>
#include <string.h>

#use delay(clock=4000000)
#pin_select U1TX=PIN_B10  //RS-232 TX PIN 21
#pin_select U1RX=PIN_B11  //RS-232 RX PIN 22
#pin_select U2TX=PIN_B14  //RS-232 TX PIN 21
#pin_select U2RX=PIN_B15  //RS-232 RX PIN 22
#use rs232(UART1,BAUD=19200, STREAM=PC1)
#USE RS232(UART2,BAUD=19200, STREAM=PC)

But I don't know how to enable irda option. Data sheet says IREN=1 but but how I will define this? Does anyone has example code or idea about this?
Thanks.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Mar 26, 2009 3:01 pm     Reply with quote

Define it straightforward according to the SFR address in the datasheet, e.g.
Code:
#bit U1_IREN = 0x221.4
....
U1_IREN = 1;
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