Delay update log(?)

Firmware/software/electronics/mechanics
Post Reply
cha8138
Beginner
Posts: 12
Joined: Wed Jul 05, 2017 7:46 am

Delay update log(?)

Post by cha8138 »

Hi.
Currently, I am working on registering values on log and receiving data using python3 library.

I tried to update integer data(65 to 90) in order and monitored the received data with Crazyflie PC client.
But the received data wasn't matching with the data I updated.

Here is my code and result.

Code: Select all

#define DEBUG_MODULE "uartDeck"
#include "debug.h"

#include "deck.h"
#include "deck_core.h"

#include "log.h"
#include "FreeRTOS.h"
#include "stdbool.h"
#include "timers.h"

#include "uart1.h"
#include "console.h"
#include "task.h"


//static xTimerHandle timer;
char cData;
char i=65;

void receiveData(void *param)
{

	//DEBUG_PRINT("Running Uart:\n");
	while(1)
	{
		cData=i;
		i++;
		if(i==90)
			i=65;

	}

}


static void uartCommInit(DeckInfo *info)
{
  uart1Init(9600);
  xTaskCreate(receiveData, "commUart",configMINIMAL_STACK_SIZE, NULL, /*priority*/1, NULL);
  DEBUG_PRINT("Inited uartComm deck.\n");
}


static const DeckDriver uartCommDriver = {
  .name = "commUart",
  .usedGpio = 0,
  .init = uartCommInit,
};

DECK_DRIVER(uartCommDriver);

LOG_GROUP_START(myUartData)
LOG_ADD(LOG_UINT8, character, &cData)
LOG_GROUP_STOP(myUartData)

Image
Image

Is there any problem in my code? or Is there any limit on the rate of updating data?

Thank you.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Delay update log(?)

Post by tobias »

Yes the data update is limited to the specified sample rate and currently limited to every 10ms. So you are seeing an aliasing effect.
cha8138
Beginner
Posts: 12
Joined: Wed Jul 05, 2017 7:46 am

Re: Delay update log(?)

Post by cha8138 »

tobias wrote: Fri Aug 18, 2017 12:15 pm Yes the data update is limited to the specified sample rate and currently limited to every 10ms. So you are seeing an aliasing effect.
Oh, I see. Thank you. :D
Post Reply