Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Help taskdelay

Posted by Dragie on June 9, 2008
heej all,

i am making a robot, with freertos only i am getting some problems.
the Microcontroller = ATmega32.

i made 2 tasks (they work fine).

task 1, says what dance move he must do.
task 2, says what ports he must set high (to dance).

then i got an external interrupt. when he sees an interrupt on the front is has to stop and move backwards. the commands it sets are in task 2 to.

somehow it seems it is doing 2 commands @ the same time but i have no clue why.
in the external interrupt it wil put temp on 0.
example code:

if (temp == 1)
if ((x == 1) && (y == 0) && (z == 0) && (w == 0))
PORTB = ~0x10;
vTaskDelay( 3000 / ( portTickType ) 2 );
etc to dance

if (temp == 0)
if (evede == 1)
temp = 0;
PORTB = ~0xFF;
vTaskDelay( 3000 / ( portTickType ) 2 );
PORTB = ~0xA0;
vTaskDelay( 3000 / ( portTickType ) 2 );
temp = 1;

i also tryed to just make 2 task instate of temp == 0 amd temp == 1;

but i can't get the tasksuspend and resume to work (they are turned on 1 in the config file)

anny1 know what is going wrong, if you wanne / can help you can always contact me on MSN messenger to: mike.aalbers@upcmail.nl



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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner