Internships/ProjectIdeas/ArduinoVisualisation

From QEMU
Revision as of 11:57, 9 March 2020 by Joaquin (talk | contribs)

QEMU emulated Arduino board visualizer

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.

For details of the intended implementation access to ArduinoVisualisation:detail

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.

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

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)