Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - enrico

Pages: [1]
1
NXPTM M522XX, KINETIS and i.MX RT / Generate output clock with KL03Z
« on: August 25, 2016, 10:04:52 PM »
Hi all,

I'd like to generate an internal clock from the KL03 and output the signal through a GPIO pin. Specifically I need a clock between 6 and 12MHz, which I'd like to use to drive an FPGA. I tried with the PWM modules, but it seems I can't go above 4MHz, and I'm not even sure this is the best approach. Is there a way to output directly to a pin one of the internal KL03 clocks?

Below is the code I'm currently using for the PWM approach that gives 4MHz output on PB11.

Code: [Select]

    PWM_INTERRUPT_SETUP pwm_setup;
    pwm_setup.int_type = PWM_INTERRUPT;
    pwm_setup.pwm_mode = (PWM_SYS_CLK | PWM_PRESCALER_1);             // clock PWM timer from the IRC48M clock with /1 pre-scaler
    pwm_setup.int_handler = 0;                                           // no user interrupt call-back or DMA on PWM cycle
    pwm_setup.pwm_frequency = PWM_TIMER_US_DELAY(TIMER_FREQUENCY_VALUE(500000), 8);                   
    pwm_setup.pwm_value   = _PWM_PERCENT(50, pwm_setup.pwm_frequency);   // 50% PWM (high/low)
    pwm_setup.pwm_reference = (_TIMER_0 | 0);                            // timer module 0, channel 0
    fnConfigureInterrupt((void *)&pwm_setup);                            // enter configuration


Thank you,
Enrico

2
NXPTM M522XX, KINETIS and i.MX RT / KL03Z and low power modes
« on: November 06, 2015, 10:43:56 PM »
Hello,

I am studying how uTasker manages low power modes for the KL03Z MCU. My final objective is to bring the MCU to a very low energy state (ideally very low leakage state) and use a low power timer to awake it every once in a while. Does this sound reasonable and feasible with the KL03Z?

Starting from this interesting wiki
http://www.utasker.com/kinetis/LLWU.html
I've learned that uTasker is already switching from WAIT to RUN when there are operations to perform and to STOP when there are no tasks to perform. Is this correct? Does this apply for the KL03 as well or it uses very low power states?


By analyzing the MCU energy consumption, I get an intermitting behavior that confirms what said above. The screenshot below shows the energy and the accumulated energy in time (uJ and s units).
https://www.dropbox.com/s/bmxfjf8nhjm35a3/Screenshot%202015-11-06%2016.23.27.png?dl=0

However, the off times give very low energy consumption (I get zero, which means current is lower than 500nA that is the measuring sensitivity), that does not match the energy consumption of the STOP mode provided in the data sheet. Is it really going to STOP mode? I guess this is performed into fnDoLowPower function, but I can't understand to what state this is going.

Also, the off times are about 0.2s while the on times are about 0.4s. Is this because of the watchdog? I currently have only an SPI transmission task every 4 seconds.

Looking forward to hearing from you.

Best,
Enrico


3
NXPTM M522XX, KINETIS and i.MX RT / FRDM-KL03Z debug, LED and SPI
« on: September 17, 2015, 03:49:10 PM »
Hi all,

I am moving my fist steps with uTasker and I need some guidance to understand how things work.

1) I've followed this guide to run uTasker and create the first task
http://www.utasker.com/docs/uTasker/uTaskerV1.4_user_guide.PDF

However, I can't see the output of fnDebugMsg. I am using OpenSDA to debug (PEmicro drivers, KDS 3.0), and I am expecting the output on the terminal (I am using Tera Term). Am I missing something?

2) As a first example I want to trigger some LEDs on and off. Is there any basic guide on how to create this simple task?

3) I need to setup an SPI connection, and in the past I was using PEx for that. What is the best way to do it without PEx? It seems like the nRF24201 module is a good starting point, but I wonder if there is something more specific.


Thanks,
Enrico

Pages: [1]