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 accessing xLCDQueue from other modulesPosted by Ralf Anders on January 18, 2009 Hi, in order to send msg's to the LCD from other modules, I made the following changes to demo code
// main.c : //replace //static xQueueHandle xLCDQueue; //with extern xQueueHandle xLCDQueue;
// main.c : //replace // xLCDQueue = xStartLCDTask(); //with /* xLCDQueue = */ xStartLCDTask();
and I intended to put the following code to other module (e.g. comtest.c):
extern xQueueHandle xLCDQueue; static portCHAR sLCDBuffer[17]; static xLCDMessage xLCDMsg = { 500 / portTICK_RATE_MS, sLCDBuffer }; //... xLCDMsg.pcMessage = "TX..."; xQueueSend( xLCDQueue, &xLCDMsg, 0);
So in all cases the xLCDQueue defined in lcd.c should be used (instead of the static copy in main.c, which is not accessible from other modules).
This seemed to work. My intention is, to show (some of the) transmitted characters on the LCD. So I additionally lowered the frequency of transmission by #define comTX_MIN_BLOCK_TIME ((portTickType)(1500 / portTICK_RATE_MS)) to have a chance to see the characters on LCD. (Note: Making it too low causes "COM errors" - that's OK)
But there is a certain behavior: It often happens, that the LCD-lines are not swapped and the first character is missing. For example there is "ass 9" instead of "Pass 9".
Note: This happens already with a large comTX_MIN_BLOCK_TIME and without queuing from other tasks.
what do I wrong? ralf
RE: PIC32 accessing xLCDQueue from other moduPosted by MEdwards on January 18, 2009 There is nothing wrong with the way you are accessing the queue handle. I suspect the problem is how the characters are written to the lcd. Could they be wrapping around?
RE: PIC32 accessing xLCDQueue from other modulesPosted by Ralf Anders on January 18, 2009 I just took an original v.5.0.3-demo and made my described modifications. And sorry, I can not reproduce my troubles. I come back, as soon as I can give a reproduceable description... ralf
RE: PIC32 accessing xLCDQueue from other moduPosted by Ralf Anders on January 20, 2009 Hi, in the mean time I found a short reproduceable way:
- 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 !
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
3. configTICK_RATE_HZ = 100 - the original demo seems to work - but queuing LCD-messages from the COM-Task (that's my original intention) cause heavy problems: * the LCD line-switch does not work properly * the first character is lost very often.
For my intentions I do not need a tickrate of 1000 Hz. This is according to the documentation. But at least the demo LCD-task should work properly at nearly all lower tickrates.
ralf
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|