From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Joaquin de Andres <me@xcancerberox.com.ar>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Pavel Dovgalyuk" <dovgaluk@ispras.ru>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael Rolnik" <mrolnik@gmail.com>
Subject: [GSoC/Outreachy] Arduino complete setup visualization and emulation
Date: Mon, 10 Feb 2020 20:58:28 +0100 [thread overview]
Message-ID: <CAAdtpL524K2QFSU9ZK2zbW_EJyiDPJ=efhwRWVzCpsJUP6HioA@mail.gmail.com> (raw)
[*] 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.
[*] Prerequisite:
- AVR port and Arduino machines merged upstream
- AVR flash device working (for firmware upload via IDE)
This works applies to a specific circuit configuration represented as
a netlist.
[*] Deliverables
- IDE Integration
Configure QEMU with the Arduino IDE (using chardev UART0).
Compile program and upload via serial.
- UI: Python:
Connect UART1 (via QMP or chardev), display as textbox
(input is not important at this point).
- QEMU: GPIO
Produce script to extract GPIO devices used from the netlist.
Configure QEMU devices to use the previous names/values.
Publish GPIO events (name, tension as float) via a QMP socket
(JSON form?).
Write test which runs FreeRTOS test to generates a stable output.
- UI interface (Python)
Connect to the QMP socket and display the GPIO events.
Now GPIOs are connected to LEDs. Represent graphical LEDS as ON/OFF.
Add an oscilloscope representation (matplotlib widget). Each GPIO
can be plugged into the oscilloscope channels.
Add Switch and PushButton to the UI, generating QMP events which
trigger GPIO input.
Add push button for arduino reset (already on board) signaling the
core, and switch for general power (for QEMU shutdown and start).
- Test with the arduino examples
Basic: "Blink: Turn an LED on and off."
- 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 interface (Python)
Lookup wav stream via QMP socket, connect to it, display to
oscilloscope view.
Add graphical representation of the LED intensity to the LED.
- Test with the arduino examples
Analog: "Fading: Use an analog output (PWM pin) to fade an LED."
- QEMU: ADC
Modify script to extract ADC devices used from the netlist.
Similarly to the PWM, use sound wav stream to read ADC samples.
- UI: Python
Add a textbox to set the ambient temperature (A thermometer is
connected to some ADC pin).
Use slider to set the tension sampled by the ADC (as a potentiometer)
- Test with the arduino examples
Analog: "Analog Input: Use a potentiometer to control the blinking
of an LED."
- QEMU: Other communication protocols
Modify script to extract RTC (via I2C) and SD card (via SPI) from
the netlist.
- Propose examples to Arduino IDE for these use cases.
- QEMU: Match physical electrical characteristics (extra)
Use imprecise VOL/VOH output
Check input within VIL/VIH range
Mark input dead when out of range
- Extra (fun):
Connect 2 QEMU Arduino interacting with each other
- UI: Python (extra++):
Add Seven-Segment Display
Add SSD1306 128×32 display controller or Nokia 5110 Graphic LCD
Propose examples to Arduino IDE for these use cases.
Co-mentor: Philippe Mathieu-Daudé <f4bug@amsat.org>
Co-mentor: Joaquín De Andres <me@xcancerberox.com.ar>
Reference Schema:
+-----+---------------------+
| | |
| | |
| | |
| | Arduino IDE |
| | |
| | |
| +---------------------+
| | |
| | |
+-----+------------------+--+
|
|console
+------------------+ |chardev
| | |
| <--+
| QEMU |
PWM stream | |
+-------------+ AVR core |
| | |
| +---+ <------+
| | | | |JSON
| JSON | +------------------+ |event
| event| | I/O
| I/O | |
| | |
| +----v-----------------------------+---+
| | LED LED LED LED DIPSW |
| | +---+ +---+ |
| | |osc| +-----------------+ |osc| |
| | +---+ | | +---+ |
| | +---+ | | +---+ |
| | |osc| | Arduino board | |osc| |
| | +---+ | | +---+ |
| | +---+ | | +---+ |
| | |osc| +-----------------+ |osc| |
+----> +---+ +---+ |
| POT POT 7LED PWM PWM PWM |
+--------------------------------------+
| |
| Serial console |
+--------------------------------------+
D-Bus can be considered too:
+-----+---------------------+
| | |
| | |
| | |
| | Arduino IDE |
| | |
| | |
| +---------------------+
| | |
| | |
+-----+-------------+-------+
|
|
+-----------------+ |
| <-------+
| |
| QEMU +---------------+
| | |
| AVR core | +-----v------+
| +---------> |
| | | |
| <---------+ DBUS |
+-----------------+ | |
| |
+--+----^----+
| |
+----v-------------------------v----+--+
| LED LED LED LED DIPSW |
| +---+ +---+ |
| |osc| +-----------------+ |osc| |
| +---+ | | +---+ |
| +---+ | | +---+ |
| |osc| | Arduino board | |osc| |
| +---+ | | +---+ |
| +---+ | | +---+ |
| |osc| +-----------------+ |osc| |
> +---+ +---+ |
| POT POT 7LED PWM PWM PWM |
+--------------------------------------+
| |
| Serial console |
+--------------------------------------+
next reply other threads:[~2020-02-10 20:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 19:58 Philippe Mathieu-Daudé [this message]
2020-02-11 10:51 ` [GSoC/Outreachy] Arduino complete setup visualization and emulation Stefan Hajnoczi
2020-02-21 10:56 ` Stefan Hajnoczi
2020-02-21 11:14 ` Philippe Mathieu-Daudé
2020-02-21 18:18 ` Joaquin de Andres
2020-02-24 11:25 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAdtpL524K2QFSU9ZK2zbW_EJyiDPJ=efhwRWVzCpsJUP6HioA@mail.gmail.com' \
--to=f4bug@amsat.org \
--cc=armbru@redhat.com \
--cc=dovgaluk@ispras.ru \
--cc=marcandre.lureau@redhat.com \
--cc=me@xcancerberox.com.ar \
--cc=mrolnik@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).