The Timing of the pin change, and _time_delay through MQX

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The Timing of the pin change, and _time_delay through MQX

1,020 次查看
MichaelDavid
Contributor III

1. I'm using the GPIO through the MQX and it goes very slow, (through debug mode - FLASH - CW) about 6us to change pin state, I need it 100 time faster! 

2. I'm using the original TWR-K60N512 BSP, when I use the _time_delay(1) I get 10ms delay. why? It should be only 1ms! 

Please Help,

Michael David.

0 项奖励
回复
2 回复数

789 次查看
konrada_anton
Contributor III

You can still program the GPIO pins directly:

  1. Switch on clock for the PORT module in SIM_SCGC5
  2. Assign your pin for GPIO in the MUX field of PORTx_PCRn
  3. Set suitable GPIOx_PDDR bits to 1 for output
  4. Write suitable bits to GPIOx_PDOR, GPIOx_PSOR, GPIOx_PCOR, or GPIOx_PTOR to change your pin's state.

 

0 项奖励
回复

789 次查看
MichaelDavid
Contributor III

Thanks for your answer. I tried it before reading your reply

1.Using I/o directly gave me the wanted results.

2. the BSP has a const that the delay uses, it should be set to 1000 not to 100 to get ms.(BSP_ALARM_FREQUENCY)

0 项奖励
回复