How to access symbols in Component Development Environment driver code

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

How to access symbols in Component Development Environment driver code

1,267 Views
jerrygirard
Contributor I

When floating the cursor over the Component Inspector properties, I can see the symbol names to access.  However, some properties have more symbols listed.  See attached picture.

 

I want to get access to some Processor Expert symbols within the component driver code I am inheriting from FreescaleCAN component.  The symbols are specific settings on the Component Inspector view.  I know how to get access to the primary symbols for an actual property.  I use: @FreescaleCAN@Rate to get the bit rate for the CAN driver.  It returns "500 kbit/s".

 

I want to know how I can access the symbols highlighted in the attachment?

 

My objective is to find the bus block rate before the CAN bit timing prescaler, so I can do some calculations to set the baud rate during runtime.

 

If there is an easier way to get the S08 CANCLK frequency (maybe from CPU component) then please let me know.  Thank you.

Labels (1)
0 Kudos
4 Replies

1,142 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jerry,

After you configure the CAN bit rate ,you can check the Clock path :

pastedImage_0.png

About the configure code , after click the "generate code " button,  you can find the code in the function

of "void CAN1_Init(void) "

Hope it helps

Alice

0 Kudos

1,142 Views
jerrygirard
Contributor I

I understand your reply, but that is not what I am trying to do.

I am extending the FreescaleCAN Processor Expert component and adding a SetBitRate() method to allow the bit rate to be changed during runtime.  If you know the FreescaleCAN component, the bit rate can only be defined statically through the Component Inspector properties.  In my application, I need the option of changing it during runtime.

I want the method to be a intelligent and calculate the proper prescaler value for any given bit rate.  To do this, I need the reference point of the bus clock frequency.  This frequency will not change for the life of my project, so I can derive the constant I need from a CPU setting or some other Processor Expert symbol.  I just need to know which one to access.

Thanks.

0 Kudos

1,142 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jerry,

- We only can configure the  CAN Bit Rate at the initialize mode (INITRQ = 1 and INITAK = 1).

- And you can refer to the calculation formula to writhe the SitBitRate() function, you can find it in

the Date Sheet of your chip.

-In the code of PE, it use these code to configure the BIT Rate:

pastedImage_0.png

Hope it helps

Alice

0 Kudos

1,142 Views
jerrygirard
Contributor I

My solution was to pick up the value I needed from the 'Cpu.h' header file:

CPU_BUS_CLK_HZ              0x01312D00UL /* Initial value of the bus clock frequency in Hz */

In my case, the value was 20,000,000 decimal (20MHz), which is exactly what I needed for my formula to work correctly.

Thank you.

0 Kudos