FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2009 Threads] Atmega8 + FreeRTOS + PWMPosted by misiekg on November 5, 2009 Hello,
I have problem with cooperating of those 3 as I wrote in the title. I Set up FreeRTOS with 2 tasks(one blinking diode and sending data to another task, second getting data and showing on lcd).
It is in small robot and I need in the future get ADC readings, proceed them and move engines using PWM.
The problem is that when I use PWM everything goes wrong. Task stop communicating and I get strange captions on LCD. If I switch off PWM, when task send/get data one engine is movin a little... I can post my code here if it would help.
Thank you very much in advance for help.
RE: Atmega8 + FreeRTOS + PWMPosted by MEdwards on November 5, 2009 Sounds like the pwm code is bad, or using it in a task is causing some sort of corruption (stack overflow being most likely). Is the PWM using an interrupt or is it completely autonomous?
RE: Atmega8 + FreeRTOS + PWMPosted by misiekg on November 6, 2009 Here is my pwm code. I use first init pwm in main, and then setPwm():
void initPwm () { TCNT1 = 0; OCR1A = 0; OCR1B = 0;
TCCR1A = _BV(COM1A1)| _BV(COM1B1)| _BV(WGM11)| _BV(WGM10); TCCR1B = _BV(CS10); }
void setPwm(int le, int re) { if ( le < 0) le = 0; if (le > 800) le = 800; if (re < 0) re = 0; if (re >800) re = 800;
OCR1A = re; OCR1B = le; }
Is FreeRTOS using timer? Maybe it uses my timer1, which I use for PWM?
Thanks for your reply.
RE: Atmega8 + FreeRTOS + PWMPosted by misiekg on November 6, 2009 Even if I don't initialize PWM and don't set values it sensds signal to the pin connected to bridge while comunicating tasks.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|