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] [January 2009 Threads] PIC32 lower configTICK_RATE_HZ -> LCD problemPosted by Ralf Anders on January 23, 2009 Hi,
I start a new thread, because I think, my final question in a former thread got overlooked.
I wanted to lower the "academic value" of configTICK_RATE_HZ=1000. But I got problems with the LCD-Display (via xLCDQueue).
Scenario to quickly reproduce some of the problems: - Take the PIC32-Demo - Remove the Blocktime-Task from project (3 locations in main.c) - set configTICK_RATE_HZ (in FreeRTOSConfig.h) to a lower value !
Samples: 1. configTICK_RATE_HZ = 50 - the LCD is updated every second (like in error cases), but with "Pass 1", "Pass2", ... - the LCD line-switch does not work properly (If the BlockTime-Task was not removed, their supervising fires errors) 2. configTICK_RATE_HZ = 20 - "Error: Int queue" is shown permanent - but sometimes (very rarely) the "E" is missuing and You see "rror: Int queue" - the LCD line-switch does not work properly
Is there a knwon reason? ralf
RE: PIC32 lower configTICK_RATE_HZ -> LCD proPosted by Richard on January 23, 2009 > 1. configTICK_RATE_HZ = 50 > - the LCD is updated every second (like in error cases), but > with "Pass 1", "Pass2", ...
The delay periods are defined at the top of the file using:
#define mainNO_ERROR_PERIOD( 3000 / portTICK_RATE_MS ) #define mainERROR_PERIOD ( 500 )
The second definition should really be: #define mainERROR_PERIOD ( 500 / portTICK_RATE_MS )
With a tick of 1KHz portTICK_RATE_MS is 1000 / 1000 = 1. With a tick rate of 50Hz portTICK_RATE_MS is 1000 / 50 = 20.
> - the LCD line-switch does not work properly (If the > BlockTime-Task was not removed, their supervising fires errors)
The block time task takes various measurements and flags an error if it finds these to be outside of what it considers to be an acceptable threshold. Changing the tick frequency will change what the thresholds are so it is not unexpected for the block time task to complain. It is nothing to worry about.
The timer is setup to generate the tick interrupt using:
const unsigned portLONG ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1;
With a tick rate of 1000 ulCompareMatch will be 4999. With a tick rate of 50 ulCompareMatch will be 99999 - which is greater than a 16bit value hence the timing error you are seeing. To use such a low value you will have to change the portTIMER_PRESCALE setting (it is 8 by default).
> 2. configTICK_RATE_HZ = 20 > - "Error: Int queue" is shown permanent
No surprising as per my previous comment regarding the block time task.
> - but sometimes (very rarely) the "E" is missuing and You see > "rror: Int queue" > - the LCD line-switch does not work properly
I would guess just timing problems when writing to the LCD.
#define lcdSHORT_DELAY( 4 / portTICK_RATE_MS ) #define lcdLONG_DELAY( 15 / portTICK_RATE_MS )
Are both going to eval to 0 with such a large portTICK_RATE_MS value.
Regards.
RE: PIC32 lower configTICK_RATE_HZ -> LCD proPosted by Ralf Anders on January 23, 2009 Thanks Richard,
I think I'll go deeper into the sources to solve my problems and I hope, You gave me the right keywords...
Generally I plan a project, where the MCU should sleep nearly all the time. It should be waked up by some external events like UART-Rcv, Input-Capure only by interrupt. A minimal power consumption is important. A wake-up by timer-interrupt is intended in "very large intervalls" (0.1 s to 10 min). It is for some idle operations, reading some analogue values (pressure, temeperature, ...).
May be, Your demonstration program is not the optimal startpoint for this kind of application? On the other side this could be a good test for the behavior in situations, that You have not tested yet.
regards, ralf
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|