- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found there are two timer like find timer and 1 sec timer on BCM20737.
IR_TX function is implemented in my application. It needs to repeat between IR_LED on and off.
For example, It has to acts as IR_LED_ON in 200ms and IR_LED_OFF in 800ms.(not us)
Are there any ID-timer defined by programmer? I ran IR_LED_ON function in 200ms .
I want to implement restarting IR_LED_ON function in 800ms .
Some solution supports like function; start_timerEx( uint8 taskID, uint16 event_id, uint32 timeout_value );
I 'm looking forward to BRCM experts' reply.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Victor,
1. The BT clock only gets multiple of 1.25 milliseconds,
2. The bt_clock_based_periodic_timer_enable is not serialized, so application timer as far as callback is going to be called in interupted context
3. If you enable ble trace in this function the connection might eventually drop
4. You cannot trace in this function - It has to be in app thread context which means you have to rewrite this function.
5. You need to post event to the application thread.
6. If you look at the running speed cadence, below, which does event seralization, you can trace as much as you like.
7. If you want timing, check on hw_timer.h it is the right thing to do.
8. Since you only get multiple of 1.25 milliseconds, bt blcock based periodic timer is not serialized.
9. If you are performing "long running stuff" your connection can be droppped.
10. If you want more accurate timing use hw_timer.h and the link is here http://community.broadcom.com/thread/4768
Hope this helps
Thanks
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We certainly have a catalog of threads on timer itself but I'm not sure have we begin to support IR, at least I don't see any sample app in the SDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the good example implementing IR_TX.
Refer to below link. I succeed my ir_tx function.
http://community.broadcom.com/message/3621#3621
I am looking for any ID-timer defined by programmer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may check out the below where they described the timer callback using the hw_timer.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use bt_clock_based_periodic_timer_Enable() function to implement various Timers.
I manage to implement IR LED on-off functions .
I wonder my ir code produces different timing in IR_LED on`.
My ir code is as below.(Repeating between holding IR_LED on 200ms and IR LED off 200ms)
I call bt_clock_based_periodic_timer_Enable(application_timer_expired_callback, NULL, 400000/625);
The registered callback function repeats.
int application_timer_expired_callback(void* context)
{
// 400 ms timer callback, do something.
ble_trace1("\rtimer_expired_callback()=%ld",ir_tx_ms);
irtx_abortCurrentTransaction();
//Todo: do you actions here every 1 second
send_buffer[0]=HIGH(3400);
send_buffer[1]=HIGH(3400);
send_buffer[2]=HIGH(3400);
send_buffer[3]=HIGH(3400);
send_buffer[4]=HIGH(3400);
send_buffer[5]=HIGH(3400);
send_buffer[6]=HIGH(3400);
send_buffer[7]=HIGH(3400);
//Send IR Code in 120 second.
if(ir_tx_ms < 120000)
{
irtx_sendData(send_buffer, 8, irtxClockSet);
ir_tx_ms=ir_tx_ms+400;
}else{
bt_clock_based_periodic_timer_Disable();
}
// Context was not allocated and so does not need to be freed. So return no action.
return BLE_APP_EVENT_NO_ACTION;
}
The below picture says IR timing in the oscilloscope measurement.
The red rectangles show IR wave forms. I wonder why my code produces different IR wave forms.
I just repeat the same buffer value in my source code.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Victor,
1. The BT clock only gets multiple of 1.25 milliseconds,
2. The bt_clock_based_periodic_timer_enable is not serialized, so application timer as far as callback is going to be called in interupted context
3. If you enable ble trace in this function the connection might eventually drop
4. You cannot trace in this function - It has to be in app thread context which means you have to rewrite this function.
5. You need to post event to the application thread.
6. If you look at the running speed cadence, below, which does event seralization, you can trace as much as you like.
7. If you want timing, check on hw_timer.h it is the right thing to do.
8. Since you only get multiple of 1.25 milliseconds, bt blcock based periodic timer is not serialized.
9. If you are performing "long running stuff" your connection can be droppped.
10. If you want more accurate timing use hw_timer.h and the link is here http://community.broadcom.com/thread/4768
Hope this helps
Thanks
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content