How Busy Will the Microcontroller Be for Generating Envelopes?

In the previous article, I described how to calculate envelope curves and how to determine the calculation parameters. This article is about calculation speed. I implemented the ADSR calculation and found that it's desirable to update envelope values as fast as every 125 microseconds (8 kHz). The STM32C092KCT controller has clock frequency 48 MHz at the highest. Each update interval has 6,000 clock cycles. I wonder the number of cycles are enough to run the envelope generator. I'm sure they are enough to calculate the values, but the controller has more jobs than that in order to run as a module: Send data to DAC, there will be two channels…

My Next Envelope Generator

I started prototyping my next envelope generator in parallel with the slow-moving VCA unit development. Unlike my previous envelope generators, this one will make envelopes by calculation instead of using an analog circuit. I'll use microcontroller STM32C092KCT as usual that has a built-in CAN controller. I expect several advantages with making an envelope generator using a microcontroller: Gate signals can be retrieved from the CAN bus; patching cables are not necessary for receiving gate signals Easy to support velocity Any curves are possible as long as the calculations catch up; it's possible to do more than ADSR You can save and load parameters I first implemented fundamental code for the…

Troubleshooting the VCA Unit

I've been building trimless VCA units. The resources are available here: https://github.com/naokiiwakami/vca-unit/tree/v2 The simulation runs well. Tested the circuits on breadboard, went fine. Built a prototype on a 3" x 2" universal PCB, working fine. But the goal size is much smaller - 7/8" x 3/8". When I try a PCB of this size, a significant offset appears on output (0.4V to 1V, negative or positive) for zero input with -5V CV. This really puzzles me as all came from the same schematic. Such a large offset causes popping noises with steep CV attacks. I need to eliminate it. I'm building two types of VCAs in this project; NPN type…

BeagleBone Green: Enable CAN on Startup

Three steps: Enable CAN overlay by configuring cape manager Configure network interface Install startup program 1. Enable CAN overlay Add following line in /etc/default/capemgr CAPE=BB-DCAN1 2. Configure network interface Add following lines in /etc/network/interfaces auto can0 iface can0 inet manual pre-up /sbin/ip link set $IFACE type can bitrate 1000000 listen-only off up /sbin/ifconfig $IFACE up down /sbin/ifconfig $IFACE down 3. Install startup program Setting the CAN interface to /etc/network/interface does not enable the CAN interface on startup for some reason. In order to workaround this problem, I installed a startup program as follows. Following link was helpful: Running a script on Beaglebone Black boot/ startup The startup script to run…

BeagleBoneGreen: Disabling Wi-Fi Power Management Permanently

The operating system is Debian. This is a dirty solution but it does work anyway. root@beaglebone:~# cat /etc/pm/power.d/wlan0_pm_off #!/bin/bash [ -x /sbin/iwconfig ] || exit 0 [ -n "`/sbin/iwconfig 2>/dev/null | grep wlan0`" ] || exit 0 /sbin/iwconfig wlan0 power off root@beaglebone:~# crontab -l | grep -v "^#" */1 * * * * /etc/pm/power.d/wlan0_pm_off root@beaglebone:~# iwconfig wlan0 wlan0 IEEE 802.11abgn ESSID:"*****" ... Power Management:off ...

Test CAN connection between BeagleBone and MIDI/CAN converter

1. Enabled CAN at 1Mbps on BeagleBone: Following operations seem to be necessary every BeagleBone boot. TBD to setup auto configuration on startup. root@beaglebone:~# echo BB-DCAN1 > /sys/devices/platform/bone_capemgr/slots root@beaglebone:~# ip link set can0 up type can bitrate 500000 root@beaglebone:~# ip link set can0 up type can bitrate 1000000 root@beaglebone:~# ifconfig can0 can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00             UP RUNNING NOARP  MTU:16  Metric:1           RX packets:2 errors:0 dropped:2 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:10            RX bytes:16 (16.0 B)  TX bytes:0 (0.0…

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…

BeagleBone notes

How to login from MacOS: Connect to the BeagleBone by a USB cable. MacOS restart is necessary for some reason. SSH to 192.168.7.2 WiFi setup: Use connmanctl as described in /etc/network/interfaces. root@beaglebone:~# connmanctl connmanctl> tether wifi disable Error disabling wifi tethering: Already disabled connmanctl> scan wifi Scan completed for wifi connmanctl> services Analog20 wifi_xxxxxxxxxxxxxxxxxxxxxxxxxxx_managed_psk connmanctl> agent on Agent registered connmanctl> connect wifi_xxxxxxxxxxxxxxxxxxxxxxxxxxx_managed_psk ... and so on Following links give useful information: http://xx-prime.hatenablog.com/entry/2016/08/13/012059 (in Japanese) https://www.mail-archive.com/beagleboard@googlegroups.com/msg40785.html The wlan0 device power management can be turned off by # iwconfig wlan0 power off TBD how to turn this off permanently. Take SD backup Insert the SD into the MacBook "diskutil list" to know…

MCP2515 beyond 1MHz

For archival purpose: http://can-bus.996267.n3.nabble.com/Anybody-ever-run-an-MCP2515-at-greater-than-1Mbps-td1859.html you are certainly right about 1Mbps being the maximum speed of the official CAN spec. However, some of us like to break the rules :) I do :) I'm using CAN for a purpose different from controlling automobile so my breaking rule would not cause any death.

Use USB-UART Bridge on PSoC CY8CKIT-049-42xx Kit

You need miniprog3 to program this, despite typical programming to this kit is via boot loader. 1. Put a SCB UART component. Change baud rate to 9600. 2. Assign pins as follows: UART RX : P4[0] UART TX : P4[1] 3. And then, here is the main.c source code int main() { CyGlobalIntEnable; /* Enable global interrupts. */ /* Place your initialization/startup code here (e.g. MyInst_Start()) */ UART_1_Start(); UART_1_UartPutString("Hello world from CY8CKIT-049-42xx\r\n"); for(;;) { /* Place your application code here. */ } } 4. Build it, program it, and connect the CY8CKIT-049-42xx to the PC. That's it.