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.


Messages - Phil

Pages: 1 2 [3] 4
31
NXPTM M522XX, KINETIS and i.MX RT / Interrupt Control
« on: September 18, 2018, 06:12:01 PM »
Mark, et al,

I am trying to read an incoming IR stream from a remote control.  From the IR receiver, I have an active-low GPIO inbound signal. All pretty straight-forward.

I was planning to create an initial interrupt upon the first active low pulse. After that, I create a periodic 1 ms timer interrupt to sample the inbound stream 68 times (68 ms total).

In this plan, I need to temporarily disable the initial interrupt so it doesn't keep triggering while I am reading the 1 ms pulses.

Just prior to restarting the initial interrupt, I need to clear the interrupt queue, if any.

It would be nice if I could SINGLE_SHOT a standard interrupt. Is that possible?

What do you recommend?

Thank you in advance.

Phil

32
Just for your information, I had CStab at 0.1uF and the USB was inconsistent. After reading this post, I changed the cap to 2.2uF and everything is now working great.  I am using a Freescale MK64 MCU.

Just wanted to emphasize this CStab suggestion by Mark.

Thank you both.

Phil

33
NXPTM M522XX, KINETIS and i.MX RT / Re: Watchdog Trigger
« on: May 26, 2018, 03:18:00 PM »
Great info.

Thanks, Mark!

34
NXPTM M522XX, KINETIS and i.MX RT / Watchdog Trigger
« on: May 25, 2018, 12:35:41 AM »
Is there a configuration setting for the watchdog timer that can be adjusted?

It looks like the watchdog is set to about 1 second.

I'd like to change that to 2 seconds or possibly 3 before a watchdog reset occurs.

I know one can retrigger the watchdog periodically but I am using a library function that prevents me from initiating a retrigger within another person's code.

Another option might be to disable the watchdog while the function is performed then re-enable the watchdog afterward. This would be good to know as well.

Thank you.

Phil

35
NXPTM M522XX, KINETIS and i.MX RT / Re: ADC Read
« on: May 15, 2018, 02:52:04 AM »
Result is always:  ADC value = 0000

36
NXPTM M522XX, KINETIS and i.MX RT / ADC Read
« on: May 15, 2018, 02:39:16 AM »
Mark,

I am trying to do a simple ADC port read and been trying to follow code from the forum to no avail.

Code: [Select]
static void fnInitADC(void)
{
    ADC_SETUP adc_setup;                                                 // interrupt configuration parameters
    adc_setup.int_type = ADC_INTERRUPT;                                  // identifier when configuring
    adc_setup.int_adc_controller = 0;                                    // ADC controller
    adc_setup.int_adc_bit = ADC_SE15_SINGLE; // pressure sensor location
    adc_setup.int_adc_mode = (ADC_CONFIGURE_ADC | ADC_CONFIGURE_CHANNEL | ADC_SINGLE_ENDED_INPUT | ADC_LOOP_MODE ); // single ended configuration in loop mode
    adc_setup.int_adc_int_type = 0;                                      // no interrupt
    fnConfigureInterrupt((void *)&adc_setup);                            // configure and start operation
}

static void fnReadPressure(void)
{
    int iADC_delay = -1;

    ADC_SETUP adc_setup;                                                 // interrupt configuration parameters
    ADC_RESULTS results;

    adc_setup.int_type = ADC_INTERRUPT;                                  // identifier when configuring
    adc_setup.int_adc_controller = 0;                                    // ADC controller
    adc_setup.int_adc_bit = ADC_SE15_SINGLE; // pressure sensor location
    adc_setup.int_adc_result = &results;
    adc_setup.int_adc_mode = (ADC_READ_ONLY | ADC_GET_RESULT);
    do {
        fnConfigureInterrupt((void *)&adc_setup);                        // get result
        iADC_delay++;
    } while (results.ucADC_status[ADC_SE15_SINGLE] == ADC_RESULT_NOT_READY);           // 'poll until the result is ready

    if (results.ucADC_status[ADC_SE15_SINGLE] != ADC_RESULT_NOT_READY) {
        fnDebugMsg("ADC value = ");
        fnDebugHex(results.sADC_value[ADC_SE15_SINGLE], 2);
        fnDebugMsg("\r\n");
    }
    else {
        fnDebugMsg("ADC not ready\r\n");
    }
}

fnInitADC() gets run at initialization.
fnReadPressure() gets run periodically from a task every 3 seconds.

MCU = MK64FX512VLL12
Pin 71 = PTC1 (ADC0_SE15)  (voltage at the pin varies from 0.5 to 2.5 vdc)

I am trying to read "ad hoc". Is a interrupt handler actually required/recommended?

37
I will try K_512_192_BM.ld.  I think this is the one you want me to use.

Thanks.

Phil

38
Mark,

Thanks for the quick reply.

I'm using the MK64FX512VLL12 which has 512K program flash, 640K total flash, and 196 SRAM.  It's not the same 1M processor used in the FRDM_K64 board.

Phil

39
Mark, et al,

I have an application that works great using uTasker. I am not trying to take advantage of the features of the Serial Bootloader so I can upload new firmware via RS232, Ethernet, USB-CDC, or USB-MSD (preferred).

The Serial Bootloader seems to be working well. I am using a switch on my custom PCB that gets it into bootloader mode and my PC opens a USB-MSD folder perfectly.

I have modified the application linker file so that it starts at 32K point per the Serial Bootloader documentation. I have attached that file called "K_512_192_Using_Bootloader.ld".  The application compiles just fine and creates .bin, .hex, and .srec files.

I drag and drop the .bin file into the MSD folder and everything seems go-to-go but the application does not start. Resetting the board does not work either. The bootloader just resets like normal.

When I load the bootloader itself and I run this in debug mode. Pausing shows it within the "irq_default(void)" undefined interrupt routine.  But, as I said before, when I trigger the bootloader switch the bootloader rumps into action and the USB-MSD pops up just fine. However, this might be a clue why things are not working properly.  I have attached the config.h and app_hw_kinetis.h files from the bootloader.

Any ideas or suggestions?

Regards,

Phil

40
µTasker general / Re: USE_SNTP vs USE_TIME_SERVER
« on: November 14, 2017, 01:24:51 AM »
I need to update this code at some point anyway. This is a good time.

Thanks, Mark.

Phil

41
µTasker general / Re: USE_SNTP vs USE_TIME_SERVER
« on: November 13, 2017, 09:09:49 PM »
This is V1.4.10 running on a MK64FX512VLL12 MCU.
Everything is working fine with the SUPPORT_SW_RTC define.

42
µTasker general / Re: USE_SNTP vs USE_TIME_SERVER
« on: November 13, 2017, 07:04:47 PM »
Mark,

You were correct. Although we had the 32 kHz clock in the schematic, our team decided NOT to populate this clock unless needed. I switched to the software clock because the LPO didn't work. I don't need a high degree of accuracy at the moment but will probably come back to it later.  In the meantime, I am getting a good consistent clock that gets updated every minute or so.

Thank you once again.

Phil

43
µTasker general / Re: USE_SNTP vs USE_TIME_SERVER
« on: November 11, 2017, 10:17:58 PM »
Mark,

Just to clarify, fnSynchroniseLocalTime() synchronizes the SNTP received UTC time to the RTC. At this point, RTC should be taking over and keeping the date/time current until the next SNTP packet request is initiated and updates the RTC once again.

fnSetShowTime(DISPLAY_RTC_TIME, cTimeDateBuf) should be return cTimeDateBuf with the current date/time.

In my testing, fnSetShowTime() returns the last UTC timestamp received and remains the same until the next SNTP update. It indicates that the RTC is not running.

What am I missing?

Thanks.

Phil


44
µTasker general / Re: USE_SNTP vs USE_TIME_SERVER
« on: November 11, 2017, 08:38:01 PM »
Mark,

Understood. This tells me that the RTC is being adjusted by local observance of DAYLIGHT_SAVINGS_SUMMER. However, the UTC code should always be referenced without this type of adjustment, correct?

Thanks.

Phil

45
µTasker general / USE_SNTP vs USE_TIME_SERVER
« on: November 11, 2017, 02:02:44 AM »
Mark,

What is the difference between USE_SNTP and USE_TIME_SERVER?

Each uses different time server IP addresses within the parameter list but both seem to update the local RTC clocks.

My UTC is off by 1 hour. Probably a daylight savings flag somewhere.

Regards,

Phil

Pages: 1 2 [3] 4