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

PIC32 lower configTICK_RATE_HZ -> LCD problem

Posted 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 pro

Posted 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 pro

Posted 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


[ 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