Modify clock associated to ports
Posted: Thu May 04, 2017 7:36 am
Hi all,
Here the code I am currently using:
stop_clock(p.cb);
set_clock_div(p.cb, CAN_CLOCK_DIVIDE);
set_port_clock(po, p.cb);
start_clock(p.cb);
I'd like to change the frequency of the clock associated to ports during execution of my code. Thus, I have a few question regarding the set_clock_div function (I can not find the detailled specification):
Does one need to stop the clock block (stop_clock) before changing the divider and to start the clock block (start_clock) again after it?
If I have a port linked to my clock block, then I change the divider of the clock block to have the clock running at another frequency, do I need to link my port with the clock block again (through set_port_clock)?
How much time does the function set_clock_div take (how much machine instructions)? Is it possible to write the same code in assembly in order for it to be faster?
Thanks
Here the code I am currently using:
stop_clock(p.cb);
set_clock_div(p.cb, CAN_CLOCK_DIVIDE);
set_port_clock(po, p.cb);
start_clock(p.cb);
I'd like to change the frequency of the clock associated to ports during execution of my code. Thus, I have a few question regarding the set_clock_div function (I can not find the detailled specification):
Does one need to stop the clock block (stop_clock) before changing the divider and to start the clock block (start_clock) again after it?
If I have a port linked to my clock block, then I change the divider of the clock block to have the clock running at another frequency, do I need to link my port with the clock block again (through set_port_clock)?
How much time does the function set_clock_div take (how much machine instructions)? Is it possible to write the same code in assembly in order for it to be faster?
Thanks