Raspberry Pi 4 Setup Notes

To prevent idle SSH sessions from being disconnected Turn off power save with wlan0. Following make the config permanent. $ sudo crontab -e # which opens the root crontab in your chosen editor... # add the following line at the bottom of the root crontab: @reboot /usr/sbin/iw wlan0 set power_save off # be sure to substitute a valid folder name for '<user>' in the line aboveBash Reference: https://raspberrypi.stackexchange.com/questions/96606/make-iw-wlan0-set-power-save-off-permanent To change boot order sudo raspi-configBash If newly installed file under /usr/local/lib are not recognized Try sudo ldconfigBash which would solve the problem if the culprit is `/etc/ld.so.cache` file. To change keyboard layout CAPS を ctrl に、L-ctrl を alt に In /etc/default/keyboard…

Preventing AVR’s EEPROM Corruption

I have been observing rhythm patterns being corrupted intermittently while I develop the firmware of the 909 clone. I first thought it is due to some bug in my firmware, but the occurrences are too random for it. I started thinking that it is some hardware problem in the processor, so looked this issue closely. I noticed that the corruptions happen only when I power cycle the processor. It’s a good clue. I searched around to know what this problem is and how to prevent it.

Asynchronous EEPROM Write Function for AVR

The TR-909 clone firmware I’m currently developing writes sequence patterns to eeprom. The avr-libc library provides eeprom writing function, but it is synchronous.

https://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html

However, many of the real-time processing in the firmware are done without interrupts, then these processes stall during the slow (synchronous) function. So I decided to develop the asynchronous version of eeprom writing function by my own.

Implementing a Decay Curve Generator into Microprocessor

In the previous article, I considered how to calculate a decay curve without using a lookup table. I tried implementing it to a microprocessor (atmega168). But I hit a few obstacles. First I planned to keep envelope value as a Q10.6 fixed point number (meaning 10 integer bits and 6 fractional bits), so that I can conveniently use a 16-bit integer. But I found it does not give enough resolution of the data. I needed to extend it to 32-bit (Q10.22). Integer part is enough with 10 bit because it's the resolution of the PWM output. Then I wrote a program like following (shortened from the actual program). It looks…

Calculating a Decaying Exponential Curve Recursively by using Fixed Point Multiplication

I've been working on implementing Envelope Generator into microprocessors. Output of an Envelope Generator consists of rising and falling exponential curve. I'm currently doing table lookup to generate those curves. https://github.com/naokiiwakami/vceg This is a quick and straightforward approach, and you don't have to be worried much about data resolution. But the program is a little complicated, and memory consuming. I don't really like this approach. I don't really like the approach, so I started to think about alternative approaches. Mathematically, a exponentially decaying curve can be calculated recursively by following formula: V(i+1) = V(i) * k where 0 <= k < 1 This is very simple. You can program this…

Where should I connect the USB Connector Shield, or should I not?

I'm about to start wiring USB socket to experiment MIDI USB. But first, I wonder where I should connect the connector shield to. Should I connect the case to GND or should I do otherwise? I found a good thread in Electrical Engineering Stack Exchange. tl;dr: Never connect to GND. Leave it unconnected or connect to the shield of the rig. I should take the former in my current project. Although it's long, this thread is pretty interesting so is worth reading.

DC-DC Booster Design using MC34063

DR-110 that I am modifying currently takes 6V power supply from 4 AA batteries or 9V from an AC adapter. But since I'm thinking of connecting to USB, it's convenient if we can draw power from it. From the device circuit diagram, I found the device requires at least 6V supply although USB supply power is 5V. It's a good opportunity to learn how to use DC-DC booster since more project that uses USB will come. I live near Jameco. It's the best to use one they carry. It's even better if the package is DIP since I often use breadboards. I checked their catalog and found a switching regulator…

Building DPDK on Raspberry Pi 3

I'm trying to build DPDK on Raspberry Pi 3 but couldn't do it on Raspbian since it's a 32-bit OS. DPDK uses several assembler instructions for ARM 8 that are only valid on 64-bit OS. So my effort starts with installing a 64-bit OS. I found SUSE has released 64-bit Linux for Raspberry Pi 3:https://en.opensuse.org/HCL:Raspberry_Pi3 I started with this OS image. Choosing the Image Three versions of distributions are avalable for Raspberry Pi 3: openSUSE Leap openSUSE Tumbleweed non-upstream openSUSE Tumbleweed I tried openSUSE Leap first, but could not zypper update. Then I tried openSUSE Tumbleweed. This worked fine. There are four variations of images: JeOS image (Just Enough OS)…

Enable CAN on the BeagleBone Green

I've tried to enable CAN on my BeagleBone Green board. I had to stop the work before verification, because my logic analyzer is unavailable now. I record what I did in this article to make things reproducible when the logic analyzer is back. There are several helpful links: http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/ http://electronics.stackexchange.com/questions/195416/beaglebone-black-can-bus-setup https://groups.google.com/forum/embed/?place=forum/beagleboard&showsearch=true&showpopout=true&showtabs=false&hideforumtitle=true&parenturl=http%3A%2F%2Fbeagleboard.org%2Fdiscuss%23bone_forum_embed#!category-topic/beagleboard/can/SjWwVngIPh8 Readings to understand device tree overlay: Device Tree for Dummies: http://events.linuxfoundation.jp/sites/events/files/slides/petazzoni-device-tree-dummies.pdf Device Tree Overlays (in adafruit) https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/device-tree-overlays Here are what I did: # make a workspace root@beaglebone:~# mkdir can root@beaglebone:~# cd can root@beaglebone:~/can# pwd /root/can # check if CAN is enabled ... no root@beaglebone:~/can# dmesg | grep can # take backup of the original device tree blob file for…