Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

PIC18 MCC18 function parameters not working

Posted by Joe Martinosky on April 29, 2008
I am starting to experiment with FreeRTOS on the PIC18f87J11, and have the latest version of it as well as the Microchip tools. I am running into a strange problem where data sent to vTaskDelay doesn't work. I thought I'd write a little LED flasher, but I can't get the delay to work. I have tried passing a variable, defined in the task, as well as directly passing a value. When I debug into the vTaskDelay function, the passed parameter is always 0.

Ideas?

void vLED_task(void *pvParameters);

void main(void)
{
port_init();
PORTCbits.RC2 = 1;

xTaskCreate(vLED_task, "LED", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);
vTaskStartScheduler();

}


void vLED_task()
{
portTickType xDelayTime = 500;

while(1)
{
PORTCbits.RC2 = ~PORTCbits.RC2;
vTaskDelay(10/*xDelayTime*/);

PORTCbits.RC2 = ~PORTCbits.RC2;
}
}

I first thought it might be a problem with bank addressing, so I spent a lot of time single-stepping through the assembly code. I understand what the processor is doing, now, but that didn't help me with the problem. I've looked at the post from John Franklin, and implemented it, as well, but to no avail.

Thanks

RE: PIC18 MCC18 function parameters not working

Posted by Dave on April 29, 2008
Strange, its a simple enough program. Does the demo app for your hardware work ok? Are you sure that the value within vTaskDelay() truly is zero and that its not just an issue with viewing the value within the debugger. I know some debuggers will not show variables that are in registers properly. Are you using optimization?

Sorry, more questions than answers.

RE: PIC18 MCC18 function parameters not working

Posted by Joe Martinosky on April 29, 2008
I'm not using hardware that's compatible with the demo app, so I don't know. I don't believe it's a visibility problem with the debugger because the processing that follows matches what happens if the passed value is zero.

Optimizations are turned off.

My boss has experienced the same problem but attributed it to something else he was doing wrong. He didn't trace it down, though.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists