Internships/ProjectIdeas/ArduinoVisualisation: Difference between revisions

From QEMU
(Start 'Interaction with virtual sensors using the Arduino board'.)
 
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== Interaction with virtual sensors using the Arduino board ===
= QEMU emulated Arduino board visualizer =
 
[[File:ejecution_flow.png|800px|Execution flow.]]
   
   
'''Summary:''' The project will add a visual representation of an Arduino board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interracting with the code via external events (sensors) triggers changes on the UI.
== Summary ==
 
'''Goal:''' Be able to use a visual virtual Arduino board, and program it with the Arduino IDE. The result should be easily usable by newcomers to the Arduino world.
The project will add a visual representation of an Arduino based board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interacting with the code via external events (widgets) triggers changes on the UI.
 
For details of the intended implementation access to [[Internships/ProjectIdeas/ArduinoVisualisation:detail]].
 
== Goal ==
 
Be able to use a QEMU emulated Arduino as part of a virtual board. Use the virtual board for interaction with the QEMU emulated Arduino and for visualization of the board states. Be able to program the emulated Arduino with the Arduino IDE.  
 
The result should be easily usable by newcomers to the Arduino world.
 
== Deliverables ==
 
The project is divided in several deliverables:
 
=== IDE Integration ===
 
* Configure QEMU with the Arduino IDE (using chardev UART0).
* Compile program and upload via serial.
* The IDE doesn't need modifications.
 
=== UI (Python) ===
 
* Connect UART1 (via QMP or chardev), display as textbox (input is not important at this point).
 
=== QEMU: GPIO ===
 
* Produce a script to extract the GPIO devices from the netlist.
* Configure QEMU devices to use the previous names/values.
* Publish GPIO events (name as a string and tension as float) via a QMP socket (JSON form?).
* Write a test which runs FreeRTOS to generate a stable output.
 
=== UI (Python) ===
 
* Connect to the QMP socket and display the GPIO events.
* Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
* Add an oscilloscope representation (matplotlib widget). Each GPIO can be plugged into the oscilloscope channels.
* Add Switches and PushButtons to the UI, generating QMP events which trigger GPIO input.
 
=== QEMU: PWM ===
 
* Modify script to extract PWM devices used from the netlist.
* Configure QEMU devices to use the previous names/values.
* Use QEMU sound API to generate a stream of PWM values (as a wav).
* Add a QMP command to lookup the PWM wav stream.
* Write a FreeRTOS test producing a sinusoidal via PWM, verify the wav form.
 
=== UI (Python) ===
 
* Lookup the wav stream via the QMP socket, connect to it, display it on the oscilloscope view.
* Add a graphical representation of the LED intensity.


'''Deliverables'''
=== QEMU: ADC ===


* IDE Integration
* Modify the script to extract the ADC devices from the netlist.
  Configure QEMU with the Arduino IDE (using chardev UART0).
* Similarly to PWM, use the sound wav stream to read ADC samples.
  Compile program and upload via serial.
  The IDE doesn't need modifications.


* UI (Python)
=== UI: Python ===
  Connect UART1 (via QMP or chardev), display as textbox
  (input is not important at this point).


* QEMU: GPIO
* Add a textbox to set the ambient temperature (a thermometer is connected to some ADC pins).
  Produce a script to extract the GPIO devices from the netlist.
* Use a slider to set the tension sampled by the ADC (like if it was a potentiometer).
  Configure QEMU devices to use the previous names/values.
  Publish GPIO events (name as a string and tension as float) via
  a QMP socket (JSON form?).
  Write a test which runs FreeRTOS to generate a stable output.


* UI (Python)
== Materials provided ==
  Connect to the QMP socket and display the GPIO events.
  Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
  Add an oscilloscope representation (matplotlib widget). Each GPIO
  can be plugged into the oscilloscope channels.
  Add Switches and PushButtons to the UI, generating QMP events which
  trigger GPIO input.


* QEMU: PWM
=== Boards definition ===
  Modify script to extract PWM devices used from the netlist.
  Configure QEMU devices to use the previous names/values.
  Use QEMU sound API to generate a stream of PWM values (as a wav).
  Add a QMP command to lookup the PWM wav stream.
  Write a FreeRTOS test producing a sinusoidal via PWM, verify the
  wav form.


* UI (Python)
[https://gitlab.com/xcancerberox/arduino-example-circuits/-/blob/master/arduino_led/arduino_led.sch A specific circuit configuration] represented as a netlist.
  Lookup the wav stream via the QMP socket, connect to it, display
  it on the oscilloscope view.
  Add a graphical representation of the LED intensity.


* QEMU: ADC
=== Arduino code examples ===
  Modify the script to extract the ADC devices from the netlist.
  Similarly to PWM, use the sound wav stream to read ADC samples.


* UI: Python
[https://www.arduino.cc/en/Tutorial/BuiltInExamples Preset Arduino exanples] compliant with QEMU limitations:
  Add a textbox to set the ambient temperature (a thermometer is
  connected to some ADC pins).
  Use a slider to set the tension sampled by the ADC (like if it
  was a potentiometer).


'''Materials provided'''
* [https://www.arduino.cc/en/Tutorial/Blink Digital example]: "Blink: Turn a LED on and off."
* [https://www.arduino.cc/en/Tutorial/Fading Analog example]: "Fading: Use an analog output (PWM pin) to dim a LED."
* [https://www.arduino.cc/en/Tutorial/AnalogInput Analog example]: "Analog Input: Use a potentiometer to control the blinking of a LED." QMP commands documentation


* [https://gitlab.com/xcancerberox/arduino-example-circuits/-/blob/master/arduino_led/arduino_led.sch a specific circuit configuration] represented as a netlist.
=== Extra tasks ===
* [https://www.arduino.cc/en/Tutorial/BuiltInExamples preset Arduino tests] compliant with QEMU limitations.
* [https://www.arduino.cc/en/Tutorial/Blink Digital example]: "Blink: Turn a LED on and off."
* [https://www.arduino.cc/en/Tutorial/Fading Analog example]: "Fading: Use an analog output (PWM pin) to dim a LED."
* [https://www.arduino.cc/en/Tutorial/AnalogInput Analog example]: "Analog Input: Use a potentiometer to control the blinking of a LED."
* QMP commands documentation


[https://www.mail-archive.com/qemu-devel@nongnu.org/msg681744.html Additional tasks are available] for applicants who completes the project.
[https://www.mail-archive.com/qemu-devel@nongnu.org/msg681744.html Additional tasks are available] for applicants who completes the project.
    
    
'''Essential skills required'''
== Essential skills required ==


* Fluent in C
* Fluent in C
* Comfortable programming in Python
* Comfortable programming in Python
* Knowledge of Javascript might be useful (Java will *not* be used).
* Knowledge of Javascript might be useful (Java will *not* be used).
* Working knowledge with User Interfaces
* Working knowledge with User Interfaces


Electrical engineering background is not essential
Electrical engineering background is not essential


'''Details:'''
== Details ==


* Skill level: intermediate to advanced
* Skill level: intermediate to advanced
* Language: C
* Language: C
* Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
* Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
* Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)
* Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)

Latest revision as of 12:29, 9 March 2020

QEMU emulated Arduino board visualizer

Execution flow.

Summary

The project will add a visual representation of an Arduino based board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interacting with the code via external events (widgets) triggers changes on the UI.

For details of the intended implementation access to Internships/ProjectIdeas/ArduinoVisualisation:detail.

Goal

Be able to use a QEMU emulated Arduino as part of a virtual board. Use the virtual board for interaction with the QEMU emulated Arduino and for visualization of the board states. Be able to program the emulated Arduino with the Arduino IDE.

The result should be easily usable by newcomers to the Arduino world.

Deliverables

The project is divided in several deliverables:

IDE Integration

  • Configure QEMU with the Arduino IDE (using chardev UART0).
  • Compile program and upload via serial.
  • The IDE doesn't need modifications.

UI (Python)

  • Connect UART1 (via QMP or chardev), display as textbox (input is not important at this point).

QEMU: GPIO

  • Produce a script to extract the GPIO devices from the netlist.
  • Configure QEMU devices to use the previous names/values.
  • Publish GPIO events (name as a string and tension as float) via a QMP socket (JSON form?).
  • Write a test which runs FreeRTOS to generate a stable output.

UI (Python)

  • Connect to the QMP socket and display the GPIO events.
  • Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
  • Add an oscilloscope representation (matplotlib widget). Each GPIO can be plugged into the oscilloscope channels.
  • Add Switches and PushButtons to the UI, generating QMP events which trigger GPIO input.

QEMU: PWM

  • Modify script to extract PWM devices used from the netlist.
  • Configure QEMU devices to use the previous names/values.
  • Use QEMU sound API to generate a stream of PWM values (as a wav).
  • Add a QMP command to lookup the PWM wav stream.
  • Write a FreeRTOS test producing a sinusoidal via PWM, verify the wav form.

UI (Python)

  • Lookup the wav stream via the QMP socket, connect to it, display it on the oscilloscope view.
  • Add a graphical representation of the LED intensity.

QEMU: ADC

  • Modify the script to extract the ADC devices from the netlist.
  • Similarly to PWM, use the sound wav stream to read ADC samples.

UI: Python

  • Add a textbox to set the ambient temperature (a thermometer is connected to some ADC pins).
  • Use a slider to set the tension sampled by the ADC (like if it was a potentiometer).

Materials provided

Boards definition

A specific circuit configuration represented as a netlist.

Arduino code examples

Preset Arduino exanples compliant with QEMU limitations:

  • Digital example: "Blink: Turn a LED on and off."
  • Analog example: "Fading: Use an analog output (PWM pin) to dim a LED."
  • Analog example: "Analog Input: Use a potentiometer to control the blinking of a LED." QMP commands documentation

Extra tasks

Additional tasks are available for applicants who completes the project.

Essential skills required

  • Fluent in C
  • Comfortable programming in Python
  • Knowledge of Javascript might be useful (Java will *not* be used).
  • Working knowledge with User Interfaces

Electrical engineering background is not essential

Details

  • Skill level: intermediate to advanced
  • Language: C
  • Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
  • Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)