How to Calculate Cycle Counter Value/Mask

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Calculate Cycle Counter Value/Mask

1,872 Views
Kartoon67
Contributor III

Hi,

 

I would like to know, how i can calculate the right cycle counter value and mask for a transmisting frame?

 

For exemple, in a transmit frame on SLOT 1 I have this two values:

 

0x11,                           // Transmit cycle counter filter value   0x22,                           // Transmit cycle counter filter mask

 When i watch the result in my oscilloscope, I see that my frame is sending just the following cycle :

 

Cycle 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28 and 29.

 

But I don't find the relation between the counter filter value and mask, and how to calculate them.

 

Thanks in advance,

 

Regards,

Labels (1)
0 Kudos
Reply
5 Replies

1,570 Views
Kartoon67
Contributor III

I have past my entire afternoon to try to understand that computation between the Cycle Mask and value. I have tried some value into each of them, but i don't find the relationship.

 

Need some helps, it's very important because I need to send Frame into specific Cycle. If I can't do that, I can't continu my project.

 

Thanks in advance,

0 Kudos
Reply

1,570 Views
Kartoon67
Contributor III

In the documentation of my MCU, the calculation for the cycle counter is donne like this :

 

MBCCFRn[CCFVAL] ^ MBCCFRn[CCFMSK]

 

CCFVAL = Cycle Counter Value

CCFMSK = Cycle Counter Mask

 

For example, I put 0x01 in CCFVAL and 0x02 in CCFMSK

 

By computation CCFVAL XOR CCFMSK = 0x03

 

So, if I understand, my cycle goes to be from 0 to 3.

 

But when I try this, I see in oscilloscipe other cycle like 8, 44, 24 etC....

 

So i don't see where i have a mistake

0 Kudos
Reply

1,570 Views
R_BenAmor
Contributor I

Good Morning,

 

I have the same problem like you. I'm searching information in datasheet and different forum, but for now i don't find a responses to that subject.

0 Kudos
Reply

1,570 Views
Kartoon67
Contributor III

Hi,

 

Indeed, I think the documentation is not well explain about that... And for now i'm blocked into this calculation... I hope somebody could be help me because I have to show at the end of the week the result of my work to my boss

0 Kudos
Reply

1,570 Views
Kartoon67
Contributor III

Hmm, any response...

 

I do some test, I can now specify just one specific cycle. You have to make the value of mask at 0x3F and in the counter value, you can specify the cycle you want.

 

In ma case i did that :

3,                           // Transmit cycle counter filter value   0x3F,                           // Transmit cycle counter filter mask

 

In that configuration, my fram goes to be send in every third cycle that all.

 

But if you want specify more than one cycle, I don't find the right calculation. It's a freescale mystery...

0 Kudos
Reply