Messages - bhabrooo

Hello people, alright so after completing my project i wanted to make the communication between my RFduino and the android application secure. Hence the natural option is AES encoding in particular 256 bit encoding. i opted to used the AESLib from the following GitHub repositry:https://github.com/DavyLandman/AESLib

now the code compiles just fine normalbut as soon the line #include <AESLib.h> is added on top the RFduino compiler doesn't compile anymore.the following is error generated:

Thanks for this example of how to use a nordic timer. I was curious what timers are used for PWM signals? If I have an application that uses I2C, BTLE, and PWM do I still have a timer available for my own needs - like changing the PWM output on a pin?

Well the thing is whether you a timer available or not depends on the code you've implemented!If you're using a timer solely for PWM then NO you don't have any timers left for use.However what you could do is that use the timer which is being used in PWM to do some other task also .... i.e make an ISR (interrupt service routine) that not only generates your required PWM control signal but performs tasks in parallel (not really parallel though)

ALternatively, you could Stop the i2c protocol after you've read your data from the device e.g accelerometer and use that timer for another purpose and keep switching back and forth.

lastly, (i don't recommend this if time precision is required) use a new count variable that updates periodically and use that (make your own timer)Just be careful that whatever code is written in the ISR executes completely before the next interrupt is thrown otherwise you'd overload the stack as in:

Well here's the basic info i know:we have 3 timers Timer 0 (used by BLE stack) so not usable if you want use Bluetooth!Timer 1 Timer 2 If you are using serial communication e.g i2c then another timer will be used up for it so you'll only have one timer available!Another point to note is that Timer1 and Timer2 work only in 16 bit mode even if you try to change themTimer0 can operate in 32 bit mode

Here's a working example code i made in which timer2 is used to generate a square wave.It pretty similar to one the codes above but this one is simplified

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Conversion to make cycle calculation easy // Since the cycle is 32 uS hence to generate cycles in mS we need 1000 uS // 1000/32 = 31.25 Hence we need a multiplication factor of 31.25 to the required cycle time to achive it // e.g to get a delay of 10 mS we would do // NRF_TIMER2->CC[0] = (10*31)+(10/4); //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The timer_config() cofucntion generates the timer sequences for the desired value passed to it in mS e.gtimer_config(1) Generates a cycle of of 1mS and throws an interrupt when count is overtimer_config(5) Generates a cycle of of 1mS and throws an interrupt when count is over

Hence TIMER2_Interrupt () which is an Interrupt service routine (ISR) generates high for one cycle and low for the next one.i've pretty much mentioned what every lines means/ does so there should be no problem now i guess