Quality RTOS & Embedded Software

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




Loading

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:

for(;;)
{
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

grtz

dragie


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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