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

EM4095 Driver Problem!!

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



Joined: 10 Sep 2003
Posts: 13

View user's profile Send private message

EM4095 Driver Problem!!
PostPosted: Sat May 07, 2005 6:17 pm     Reply with quote

Hello There,

I am trying to use em4095 chip with CCS picc compiler driver. I am using 18f2320 and 10MHz xtal in H4 mode. But I dont understand a few points in driver.

Firtstly, in CCP1 interrupt suvroutine in em4095.c, there is a line that is not so clear. I am giving the code snipped below

#INT_CCP1
void isr_ccp1()
{
int8 width;

//printf("Interrupt girisi\n\r");
// Toggle between capturing rising and falling edges to meausure width
if(RE_FE_TOGGLE)
{
setup_ccp1(CCP_CAPTURE_FE);
RE_FE_TOGGLE = 0;
}
else
{
setup_ccp1(CCP_CAPTURE_RE);
RE_FE_TOGGLE = 1;
}

// Calculate the width
width = CCP_1 - old_clock;
old_clock = CCP_1;
//printf("Old Clock : %d",old_clock);


switch(RF_readMode)
{
// Use to receive manchester formatted data from a transponder
case RF_MANCHESTER_DATA:
{
if(width > 54) // Check for a phase change
{
bitValue = ~bitValue; // Invert the save bit value
storeData = TRUE; // Force a bit store
}


In code snipped above, there is a line as " if(width > 54) ". Why does this value compare with 54. What does 54 mean? Why we use 54 as comrison.

Secondly, in em4095.c, there is a function like below :

void rf_init()
{
output_low(RF_SHD);
output_low(RF_MOD);

setup_timer_1(T1_EXTERNAL | T1_DIV_BY_1);
setup_ccp1(CCP_CAPTURE_RE);
setup_ccp2(CCP_COMPARE_INT);

setup_timer_0(RTCC_INTERNAL | RTCC_DIV_256);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);
}

In code snipped above, there is a line as "setup_timer_0(RTCC_INTERNAL | RTCC_DIV_256);" . For this driver file, what clock frequency of microcontroller should we use. How can I use this driver in 10MHz H4 and 18fxxx family.

If you give me any reply, I would be gratefull. If you send some sample code snipped, It will be very usefull. Thank you for your interests.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 08, 2005 4:17 pm     Reply with quote

When CCS created the EM4xxx.C driver files for the RFID products
they must have also made some test program, to prove that the
drivers work. The test program is probably named EX_RFID.C, or
something like that. For some reason, they forgot to include it in the
compiler example files.

I think you should email CCS support and ask them if they will give
you the example programs that they used to test their EM4102.C,
EM4150.C, and EM4095.C drivers.

http://www.ccsinfo.com/techsupport.shtml
ram
Guest







Re: EM4150 Selective Write Command
PostPosted: Tue Sep 27, 2005 2:13 am     Reply with quote

How can i give the Selective Read Command to EM4150
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