Individální projekty MPOA

Mikroprocesory s architekturou ARM

Uživatelské nástroje

Nástroje pro tento web


2015:microbrewery

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.

Odkaz na výstup diff

Obě strany předchozí revize Předchozí verze
Následující verze
Předchozí verze
2015:microbrewery [2016/01/15 21:40]
Lukáš Janík [Conclusion]
2015:microbrewery [2016/01/15 22:03] (aktuální)
Lukáš Janík [Timer]
Řádek 161: Řádek 161:
 void display_print_char(const char character); void display_print_char(const char character);
 void display_print(const char *text); void display_print(const char *text);
 +void display_printxy(const char *text, uint8_t x, uint8_t y);
 </​code>​ </​code>​
 +
 +==== Menu ====
 +
 +Menu strings are saved in string array. On display redraw, string adressed by global "menu index" variable is shown. First button controls rolling over menu nodes (menu index), remaining two buttons control change of variable of interest (temperature,​ stir, program flow).
  
 ==== RTC ==== ==== RTC ====
Řádek 179: Řádek 184:
 </​code>​ </​code>​
  
-=== Programming ​===+===== Timer ===== 
 +Single 16b timer clocked at 125kHz and 3 CC units are used as interval timers.  
 +  * CC0 (20ms) handles phase outputs (LFPWM).  
 +  * CC1 (100ms) handles redraw of the display (1s), calculation of the PID and ADC triggering (3s) and increments brewing program counter.  
 +  * CC2 (1,6ms) serves for buttons debounce
  
 ====== Conclusion ====== ====== Conclusion ======
  
-This project uses newlib, the c library for embedded systems. At first, sprintf() from previously mentioned library was used for string handling, however, this function at its own consumed over 5kB of program memory which is totally unacceptable and must be replaced by custom simplified implementation. ​PID function could be further optimalised by using integers. Currently, not all goals are fullfilled because of program memory size. The use of Link Time Optimalization decreases the binary size to 14kB however for some reason LTO optimizes out interrupt service routines even if "​used"​ attribute is attached on them. The video shows current functionality including simple user menu. Desired temperature is set and PID is turned on. Whole project is assembled on breadbord, the temperature sensor is attached to power resistor, whose current is controlled by power transistor on phase 1 output. The temperature fluctuations are caused by current induced from power resistor current, these fluctuations are also causing increase of differential error of PID regulator and will be negligible on final hardware assembly.+This project uses newlib, the c library for embedded systems. At first, sprintf() from previously mentioned library was used for string handling, however, this function at its own consumed over 5kB of program memory which is totally unacceptable and must be replaced by custom simplified implementation. ​For mitigation of program size, specialized custom string functions were implemented. Currently, not all goals are fullfilled because of program memory size. The use of Link Time Optimalization decreases the binary size to 14kB however for some reason LTO optimizes out interrupt service routines even if "​used"​ attribute is attached on them. The video shows current functionality including simple user menu. Desired temperature is set and PID is turned on. Whole project is assembled on breadbord, the temperature sensor is attached to power resistor, whose current is controlled by power transistor on phase 1 output. The temperature fluctuations are caused by current induced from power resistor current, these fluctuations are also causing increase of differential error of PID regulator and will be negligible on final hardware assembly.
 Further work on this project will consist of optimalization of i2c routines (use of interrupts) and float operations. Further work on this project will consist of optimalization of i2c routines (use of interrupts) and float operations.
  
2015/microbrewery.1452890449.txt.gz · Poslední úprava: 2016/01/15 21:40 autor: Lukáš Janík