Closed ASL07 closed 4 years ago
I found
s32 Ql_Timer_Register_us(u32 timerId, Callback_Timer_OnTimer callback_onTimer, void* param);
Will try that and update this issue
yep, but GPIO is slow... GSM modules is not MCU .... unknow SoC, closed RTOS & API, watchdog... ets use or make smart sensors on SPI, I2C, UART...
yep, but GPIO is slow... GSM modules is not MCU .... unknow SoC, closed RTOS & API, watchdog... ets use or make smart sensors on SPI, I2C, UART...
I know, but I think it could work acceptably anyway
Is there any api function similar to Arduino micros() for BC66 (using OpenCPU, not Arduino)?
I have seen this macro in os_wizio.h:
#define HAL_MILLIS() (1000L * *((volatile uint32_t *)0xA2130118) >> 15) /* rollover at 0x20000 ms */
and I tried to modify it to report micros instead of millis, like so:
#define micros() (*((volatile uint32_t*) 0xA2130118) >> 15)
However, micros() is always returning 1, am I doing something wrong?
if I find free running us timer will write if you want to use "local" get_micro() - there is a solution...
for local use test.... https://github.com/Wiz-IO/LIB/blob/master/NOTES/micro_bc66.c#L57
or check default cortex-m systick counter ( I dont know freq )
#define ST_CURRENT (*((volatile unsigned long *)0xE000E018)) // ONLY READ !!!!
a = ST_CURRENT ;
for local use test.... https://github.com/Wiz-IO/LIB/blob/master/NOTES/micro_bc66.c#L57
This works! Thank you I can get relatively accurate values from the sensor now
Btw, how do you stop this timer once you don't need it anymore?
((GPT_REGISTER_T *)0xA21300D0)->gpt->GPT_CON_UNION.GPT_CON = 0x0
Thank you for the support
Hello, I need to interface OpenCPU in BC66 with a HC-SR04T ultrasonic sensor. The sensor needs a trigger pulse of 10uS and will return an echo pulse of a certain uS duration, which has to be measured by the mcu.
Is it possible to have uS resolution on OpenCPU timers (I only see millisecond resolution in the examples), or a delay_us() function?
Thanks