-
ESP32 & MicroPython 4-bit chopper
01/25/2020 at 08:24 • 0 commentsConverting setup to run on ESP32 rather than off of Arduino. Did some bit bang poking with an external clock and got it to make a sound. Hacked up some code to initialize and use ESP32 GPIO 22 for clock (Also tried 18 with hardware SPI, different challenges).
There's a issue with PWM using 10-bit duty resolution and limiting the frequency to just of 78Khz. This should be able to go up to 40Mhz with 1-bit resolution duty, but gonna track that down later.
Here's what generators a "chopper" noise.Utilizing the WiFi is totally optional, configured so that I can update main.py using WebREPL.
from time import sleep, sleep_ms, sleep_us from machine import Pin, PWM import network print("AY-3-8910 teal 00:10") #bork break sleep(1) sta = network.WLAN(network.STA_IF) sta.active(True) sta.connect('SSID', 'PASSWORD') print("WiFi Started") # dir 1 #INACT 0 0 #LATCH 1 1 #WRITE 1 0 #READ 0 1 bdir = Pin(17, Pin.OUT, value=0) bc1 = Pin(16, Pin.OUT, value=0) da0 = Pin(32, Pin.OUT, value=0) da1 = Pin(33, Pin.OUT, value=0) da2 = Pin(25, Pin.OUT, value=0) da3 = Pin(26, Pin.OUT, value=0) clock = PWM(Pin(22), 78000) def inact(): bdir.off() bc1.off() sleep_ms(1) def latch(): bdir.on() bc1.on() sleep_ms(1) def write(): bdir.on() bc1.off() sleep_ms(1) def read(): bdir.off() bc.on() sleep_ms(1) print("Initializing 'A'") #Enable Register 8 (A Level) latch() da0.off() da1.off() da2.off() da3.on() inact() #Write A Level write() da0.on() da1.on() da2.on() da3.on() inact() #Enable Register 1 (A Frequency) latch() da0.on() da1.off() da2.off() da3.off() inact() #Write A Frequency write() da0.off() da1.off() da2.off() da3.on() inact() print("b0001")
-
555 Fuzzing into the Khz
01/25/2020 at 00:45 • 0 commentsI started building a second dev breadboard, and have been thinking thru a minimalist pin connection. The core functionality for instance of controlling some tones can be done with 4 instead of 8 data bits, and one of the bus control lines can just be pulled high instead of switched.
I rigged a 555 to experiment with independently generating the clock signal, rather than utilizing a high speed output like most SPI interfaces in a micro controller can do. I also already have this perfectly functional AY-3 chip wired up and blooping a test sequence from an arduino.
What do you suppose happens if I just pull the clock pin out and use the 555 running at a much lower speed instead!? Yup, you get any even bittier grittier jam.
But wait there's more, can you imagine, what if you hook up both the 2Mhz clock and the ~180Khz 555 clock? Yup you get even awesomer FUZZ!
-
It's alive!
01/23/2020 at 09:18 • 0 commentsWired up first test chip and got it making noises and sounds!