I’m using freeRTOS in a control project. I have to sample a sensor with a frequency of at least 1kHz and feed that measure into the PI-controller algorithm. The problem is that this will have to be done for two sensors and two controllers (a PI and a PID). The problem is: what tick rate should I use? I’ve been using 100000, but from what I’ve read so far this seems to be at least exaggerated. What would you reccomend? The rtos is running on an ATmega32.
I would also like to ask for your help on the following piece of code, which is part of a task:
> xSerialPutChar( xPort, light/4, 1000);
> if( (xSerialGetChar( xPort, rc, 10)==pdPASS) && (rc!=0x00) );
> vChangeOCPWM0(0xFF - light/4);
> xSerialPutChar( xPort, rc, 10);
When I send a byte through the serial port, the microcontroller stops responding completely. Could you please tell me what’s wrong?