diff options
author | ThomasintAnker <thomasintanker1@gmail.com> | 2024-06-21 15:03:06 +0200 |
---|---|---|
committer | ThomasintAnker <thomasintanker1@gmail.com> | 2024-06-21 15:03:06 +0200 |
commit | d38d1f7abd1b91b216172f1d356cec2124e62fac (patch) | |
tree | ca73fa4881c8389688f485d39c4fd879cfe30381 | |
parent | f121de7c7e3ca8f0dc526973a5ee2586485aad22 (diff) |
WIP Added puzzle module i2c research
-rw-r--r-- | docs/research.adoc | 43 | ||||
-rw-r--r-- | docs/share/refs.bib | 19 |
2 files changed, 62 insertions, 0 deletions
diff --git a/docs/research.adoc b/docs/research.adoc index a6ef255..4f64538 100644 --- a/docs/research.adoc +++ b/docs/research.adoc @@ -522,6 +522,49 @@ The way these puzzles are solved has been summarized in this research document, but the most complete versions of how to solve these puzzles are given in the group's respective design document. +== I^2^C (Thomas) + +=== Research question + +How can we use I^2^C for the internal communication between puzzle modules +and the main controller, and how can we detect new puzzle modules using I^2^C? + +=== Puzzle Module Detection + +Puzzle module detection is vital to the puzzelbox, as this allows changing the +puzzles without much software or hardware configuration needed. An option will +be given for the choice of main controller (RP2040); namely to scan the full +I^2^C bus for responsive slaves. The RPI Pico SDK has an API for I^2^C which +also supports functions create a bus scanning function. An example of just the +bus scan function according to the API examples can be found in the code block +below. + +[source, c] +---- +#include <stdio.h> +#include "pico/stdlib.h" +#include "hardware/i2c.h" + +void bus_scan() { + int ret; + uint8_t rxdata; + + for (int addr = 0; addr < (1 << 7); ++addr) { + ret = i2c_read_blocking(i2c_default, addr, &rxdata, 1, false); + printf(ret < 0 ? "." : "@"); + printf(addr % 16 == 15 ? "\n" : " "); + } + printf("Done.\n"); +} + +---- + +// TODO: references (API) & code block naming? + +=== Arduino + + + == Research of hardware designs of previous groups (21-22 and 22-23) This part of the research looks at the hardware designs of the previous groups diff --git a/docs/share/refs.bib b/docs/share/refs.bib index b6fe625..0af5f94 100644 --- a/docs/share/refs.bib +++ b/docs/share/refs.bib @@ -192,3 +192,22 @@ publisher = {Avans University of Applied Sciences}, year = {2022}, } + +@online{Joh21, + author = {Johnston, P.}, + title = {Embedded systems testing resources}, + url = {https://embeddedartistry.com/blog/2018/10/18/embedded-systems-testing-resources/}, + month = jun, + msbib-day = {10}, + msbib-accessed = {2024-02-25}, + year = {2021}, +} + +@online{RPI23, + title = {Hardware APIs - Hardware I2C}, + url = {https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#hardware_i2c}, + month = jun, + msbib-day = {14}, + year = {2023}, + msbib-accessed = {2024-05-11}, +} |