lecture notes¶
global review previous week¶
Python based 3D CAD software: build3d
Cerrotru low temp metal, the casting metal that Neil likes is the same as LM138 from easycomposites. Make sure to dust the mold with talcum powder. It helps to preheat the mold so the alloy doesn’t cool of too fast. And then let it cool slowly. Maybe in an oven?
this weeks lecture¶
Networking is great for parallelism. Separate processors, each doing it’s own task. This makes system scalable and modular. You can also use this to prevent interference because you can now separate processors and e.g. power supply noise will be less of an issue.
wired¶
There are standardized baud rates. Modern microcontrollers can go up to 921600 baud, which is about 1Mhz.
UART = asynchronous.
USART = synchronous and asynchronous.
SERCOM = specific for CORTEX processors and are flexible (can do multiple protocols).
PIO = Programmable Input/Output. specific to RP2040.
Bit-bang = implement the protocol yourself by turning outputs on and off + capturing on an input pin.
RS232 is one-to-one. RS422 and RS485 can have multiple controllers on the line. All devices can listen to the host, but will have to fight for the return line. The nodes are parallel to each other. This works because IO ports can be 1, 0 or X (true, high or high-impedance). This is called a serial multi-drop bus. Limitation is that each node will need an address (identity).
Neopixel uses hop count. The nodes are connected serially. The host sends a message and you’re going to count hops. So for every hop, that node is incrementing the hop count and send it to the next one. There is no address in each node. There’s a resistor in the output line to pull it low. If there’s a device connected, this line is pulled high and that’s how you know if there’s someone connected. If noone is connected, your the last in the chain. You then report back the amount of hops. This way the host knows the amount of nodes available. So the hop count is the address of each individual node.
Broad hop is a hybrid between hop count and multi-drop bus. The transmit is connected parallel and broadcasts can be send over this line. The returns are connected serially through each node. This is much more quickly than hop count. Broad hop assumes there’s always a host.
The ATtiny412 (costs 15 cents) is an ideal 8 pin microcontroller that can use this. See documentation of Adrian.
In synchronous serial communication there’s always a separate clock line next to the line(s) with data. The clock line tells you when the data on the data line is valid. This is different from asynchronous where everyone has to have defined the speed rate. Next everyone has to always listen to the bus in order not to miss anything.
Synchronous serial communications are SPI and I2C.
Generally you don’t use SPI when talking between microcontrollers. You use it when you want to talk to a peripheral that talks SPI. SPI needs four lines and that’s not convenient for a networking bus (you need the chip select line too so that consumes lots of pins of the host).
non-volatile (NVM: non-volatile memory): data stays available with no power. e.g. SD cards and flash or FRAM memory in microcontrollers.
I2C has 2 lines: SDA and SCL. These lines are shared between all nodes. That’s why there are pull up resistors on the line (~ 5 kOhm) . When the line is high it is available. In Arduino I2C is called Wire.
In I2C each node needs a hardcoded address. A lot of sensors and actuators have I2C build in and use standardized addresses. Be careful of long datalines. This is because long lines have capacitance and inductance preventing from being fast. So proper termination might be needed. There are differential I2C chips available that you can use when you need longer distances (i.e. > 2 meters).
It is a convenient protocol, also between multiple microcontrollers. New upcoming standard is I3C.
MPCM is multi processor communication Mode which is an AVR protocol. See the documentation of Erwin.
ATP is an asynchronous token protocol, designed to work without clocks. It needs 4 wires. The system will automatically figure out what data rate they can talk.
wireless¶
PA = power amplifier
LNA = low noise amplifier
IF =
I/Q = how you modulate it
demod = demodulation
Antennas are typically tuned to a frequency. They can be omnidirectional or sending only to one direction (antenna gain).
Impedance matching is required so the signal is not reflected at the end of an antenna but is actually send out.
There are single-chip radios available that have all of the above integrated. This is what you’d normally use. The ESP32 has it integrated for example. It can not only connect to a WIFI accesspoint, it can actually become an accesspoint itself.
Blueart is a library created by Neil and implements a UART over bluetooth. Easy to use and just works a a wireless RS232 cable.
ESP8266 is an older processor. the ESP01 is a minimal processor that adds wifi radio onto a project (1 USD a piece). The Xiao is easier for full projects though.
RFid is not secure. Easy to hack into the protocol. There’s nothing really inside a RFID tag. You can wind your own coil, but it’s easier to just buy a couple of tags, open them up and use that.
nRF24L01+ are wireless RF transceivers that use 2.4Ghz band to send data from one to another. Longer distance and less fast is the NRF905. This uses 433, 868 or 915 MHz.
Lora is like wifi but designed for longer distances (city distances). Maturing fast.
Many frequencies are reserved for millitary, commercial and other use. Only a few bands are available for general use. Be careful with what frequency is legal in your country. Also pay attention to emission power. This is regulated as well. In europe this is 20dBm.