I got a vintage racetrack from a colleage a while back.
In the past i had some ideas controlling train or race tracks. For train tracks i wanted to write intelligent maneuver software. For a racetrack a web controllable race. Maybe with a webcam mounted on the car??
L298N – DC motor controller
So i bought a little DC motor controller (2 channels) and took a esp32.
https://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
After that go to the Board manager.
Tools > Board: ..... > Board Manager
Search board, click and install.
NOTE: Some sketches require a specific version!
Select your board, and write/open you sketch.
First thing to do is test compiling your sketch
Press the little button on the left
Libraries:
When you get a compile error like below, you are missing those libraries
Goto tools > Manage libraries
Search for your needed library, sometimes there are multiple which look alike. This is a trial and error approach. Sometimes it doesn’t exists and you need to upload a zip containing the library. (Sketch > Include Library > Add .zip library
Downloading a zip containing the library
Adding the library zip file
When looking at the first lines of you sketch, there are include statements like:
But sometimes there are statements without the < > characters. Then it will be a included file just for your sketch.
Note the second tab MPU6050x.h which contains specific code only for this sketch.
Redo a test recompile using the tic icon again.
Everything okay? .. Select the correct port in Tools > Port And press the Arrowright icon to upload/flash. Note: sometimes you have to hold a button or press a little flash button on your device to flash.
esptool.py v3.3
Serial port COM8
Connecting.....
Chip is ESP32-D0WDQ6-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:c9:a3:f9:02:d0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000c7fff...
Flash params set to 0x022f
Compressed 18880 bytes to 12992...
Writing at 0x00001000... (100 %)
Wrote 18880 bytes (12992 compressed) at 0x00001000 in 0.3 seconds (effective 482.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 627.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 1087.9 kbit/s)...
Hash of data verified.
Compressed 750976 bytes to 477779...
Writing at 0x00010000... (3 %)
...
...
...
Writing at 0x000bb633... (93 %)
Writing at 0x000c0acd... (96 %)
Writing at 0x000c6649... (100 %)
Wrote 750976 bytes (477779 compressed) at 0x00010000 in 6.3 seconds (effective 947.4 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Most of the boards you can connect via micro-usb. Sometimes you need adaptors like:
Attiny programmerttl uart interface
TIPS ‘n tricks:
Open same file in another editor, so you can compare for example the top (declarations) and futher down the code. Else you could be ending up scolling up/down all day long. And probably forgetting how a variablename was exacly spelled.
Use serial monitor! When debugging this is a valuable tool. Enter statements into you code, which prints debugging info to a serial monitoring window when your device is still hookedup to your PC.
Example printing connected IP and values registered
Other obvious tips: Add comment lines (documentation) Use variable names which make sense! ( Hard to find what aaaa() does, or what tmp-a is, but LastTempValue says a lot more)
MCH2022 is a nonprofit outdoor hacker camp taking place in Zeewolde, the Netherlands, July 22 to 26 2022. The event is organized for and by volunteers from the worldwide hacker community.
Knowledge sharing, technological advancement, experimentation, connecting with your hacker peers and hacking are some of the core values of this event.
MCH2022 is the successor of a string of similar events happening every four years since 1989. These are GHP, HEU, HIP, HAL, WTH, HAR, OHM and SHA.
I’ve bin to several of these big events. Besides these big events are many different smaller events (wannull, ne2000 etc).
First one i’ve been was HIP97. I went with Bigred at that time. I had to get the tickets at that time, he didn’t had a handle at that time. It was Monique who came up with his new nick.
After HIP97 there was HAL2001 WTH2005 and OHM2013 which i was present. HAL2001 the whole ICEcrew was present, WTH a part of them, OHM a few and i was with a few PRUTS friends.
Now i was with my girlfriend, AND with Bigred again! Loads of fun and memories. Had not seen Bigred since a inbetween hacker party at my place. So ’97 and now ’22 .. jeez 25 years!
So MCH, it was great again. Loads of stuff to do and to see. Weather was … okay. Two days where really hot, one day some light rain but a load of wind. Our neighbours tent collapsed, beer tents where reenforced. First campsite with a supermarket! Music stage was awesome, lasers and fire!
I went to a lot of talks, even my girlfriend found some she was interested in.
OpeningAt nightLast time my tapeTinkeringtar cz ourstuff.tgz
This was the last time i’ve brought my “Windows free zone tape” This big roll of tape was used on many occasions. I got this roll somewhere < 2000, I did a search but couldn’t find anything mentioning it on the web. Maybe some archive.org entry?
Starting a Home Computer Museum (which i almost did in the past)
streaming 360 video (going to try this with my Vuze XR Camera)
Non-Euclidean Doom: what happens to a game when pi is not 3.14159… (Really enjoyed this one)
Hacking the genome: how does it work, and should we?
And more
Besides the talks i’ve done some workshops:
Micropython on the badge (see my other post)
Kicad – PCB designing
Meanwhile we where looking at all the villages and hackerspaces. Loads of interesting people to meet. Like our neighbour two tents futher, he was also a home-brewer, and he brought a minifridge with beer taps connected to it.
When back at our tent or Bigreds Campervan, we talked about differences now and then. New technology, what we’ve been upto in the last years and tinkering, loads of tinkering.
I’ve brough a big plastic container with .. ehh “things to do ….”
My 6502, bigred helped me debugging the 16*2 display. (Luckily his campervan was packed with electronics!) We cannibalized one of his projects for a display, and re-flashed his eeprom programming arduino to test my display. ( The arduino i had to reflash later to program a rom he had given me for my 6502. ) Other toys he gave me: Print for the programmer, and a C64 Cartridge print for Exrom and Game.
Mini C64 with a little screen and raspberry zero.
5050 ledstrip (didn’t had time to reprogram this for our mood-light)
Handheld gamehat: Bigred found some old games he played when he was young
Mikrotik router, because i wanted to make a dmz for my girlfriends laptop. (MS)
Playing around with my Vuze XR camera
Huskycam, which i’m planning to use on a racetrack
DVB-T DAB FM Stick, got some hints and tips from Bigred. (Note to myself … fix the antenna!)
My Arduino touch bagpipe player with i2c
The wifi deauther, which has a display which i wanted to use to make a programmable clock for my 6502. Using a rotary encoder and the display to control the speed in Hz.
I spend many hours playing with the Badge and Kicad
Wrote some 6502 assembly, arduino sketches, php, bash and micropython.
While playing around with the badge i got some things working easily. Spinning logo and blinky leds. Next goal to achieve was, to get the gyroscope to control the angle of spinning. Most of the code worked, but the gyro values stayed zero! (After many hours …. you have to start/enable the chip/measurements on the bno055 first! .. duh! )
I didn’t had my dev directory from my main battlestation synced in my nextcloud, so changing things for the 6502 was a b*tch. Used vasm and acme to generate a bin file to use to fill the rom. Didn’t like the eeprom programmer program, because i could not easily check the rom contents. Have to look into that later on.
While learning to use Kicad, which i only had been using to draw schematics (besides fritzing) , i learned to create a pcb. Which gave me the idea to make a print for the power-on-reset for the 6502. Which is going to be the first PCB by ordering, instead of the old skool messing around with DIY print making. (see next post)
….. Oh, why my display was not working? I even connected my 8bit logic analyzer to the pins of the display.
Everything was correct. But i didn’t use a variable resistor for the contrast. Just a simple resistor i could find. Luckily … bigreds stash. All those hours debugging, all for one resistor! (I have to mention, we had a suspicion halfway. But it was too hot and we where too lazy to go to Bigred’s campervan, to get a potentiometer. )
65c22 connected, new data, and address-bus ribboncables!
First led on Register B blinking!
Notes: Temporary display wil be 2×16 Chars. Ram in place, but not connected (is emulated by the Arduino Mega at the moment) Rom is somewhere halfway the atlantic ocean .. still waiting on that one. Ben Eatons clock module is disconnected, i’m using the Arduino as programmable clock right now. (There wil be a little display and a rotary encoder to set clock speed.)
lda #$ff ; all bits
sta $6002 ; set direction (out) for B register
lda #$80 ; set 1 bit
sta $6000 ; set register B
lda #$00 ; reset bit
sta $6000 ; set register B
jmp $8005 ; jmp to bit set part
Almost … friday will be the day i’ll attend May Contain Hackers. Besides the awesome villages and talks.
UPDATE: 20220727 UPDATE: 20220812
You get a hackable badge, this one is more amazing as previous versions.
I can’t wait to have a go at this cool gadget. I personally could do without the pcb fancy design.
Espressif ESP32 Wrover-E with 16MB of flash storage and paired with 8MB of PSRAM, for front-end badge computing and compatibility with the badge.team ecosystem back to the 2017 SHA badge.
Lattice ICE40UP5K FPGA for hardware-accelerated graphics and user FPGA hardware designs.
Raspberry Pi RP2040 for advanced USB communication and board management.
2Ah LiPo battery to give you a full day of fun on a charge.
16-bit DAC with stereo output to headphone socket, onboard mono speaker.
ILI9341 2.2 inch TFT display with a 240 by 320 pixel resolution.
Bosch BNO055 orientation sensor.
Bosch BME680 environmental sensor.
The usual array of addressable LEDs.
SAO and Qwiic expansion connectors, FPGA PMOD expansion, plus onboard prototyping area.
Downloadable apps, micro python, Arduino ide programming. All kinds of GPIO pins, leds buttons, sound. Check out https://hatchery.badge.team/
You can play with this virtually here! https://wokwi.com/projects/335445228923126356
So much potential! Great start for a DIY project.
I won’t post about the workings, thats all well documented online. I shall post about the hacks/findings i personally did.
UPDATE: 20220727 Made a micropython program to keep your NameTag level to the ground (Better version)
UPDATE: 20220812
Someone made a 8bit logic analyser using the pmod connector !
Due to eeproms being scarce, i’m going to use a arduino as Rom emulator. Below is a test setup i’m going to build.
Made the drawing in Kicad.
KiCad is a free software suite for electronic design automation. It facilitates the design and simulation of electronic hardware. It features an integrated environment for schematic capture, PCB layout, manufacturing file viewing, SPICE simulation, and engineering calculation.
Memory assignment:
$8000-FFFF - Rom
$4000-7FFF - Ram ?
$2000-3FFF - Multiple times the 6522 *
$0000-???? - Ram probably
* This is due to the fact i am only using Address lines: 0,1,2,3,13,14,15
Below some examples and connection diagrams to control displays. More code and complete schematics will be added on this page or on a separate projects page.
UPDATE 20230119 Cost of 20×4 display in 1998
LCD
I’ve used a LCD display like this (HITACHI HD44780) on my PC in the 90s, and also written code to use this as a monitoring device on my amiga.
On Linux i used LcdProc – This module also was equiped with a serial connector
Some arduino’s have embedded displays like those i’ve used for a Lora project.
No usedWifi packet monitorLora test
Other means of connecting : SPI
SPI connected display
Nextion
Nextion is a Human Machine Interface (HMI) solution combining an onboard processor and memory touch display with Nextion Editor software for HMI GUI project development.
Using the Nextion Editor software, you can quickly develop the HMI GUI by drag-and-drop components (graphics, text, button, slider, etc.) and ASCII text-based instructions for coding how components interact on the display side.
Nextion HMI display connects to peripheral MCU via TTL Serial (5V, TX, RX, GND) to provide event notifications that peripheral MCU can act on, the peripheral MCU can easily update progress, and status back to Nextion display utilizing simple ASCII text-based instructions.
edit cmdline.txt
add "fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo"
at the end
edit config.txt
add between custom comments at the bottom
dtoverlay=piscreen,speed=24000000,rotate=90
# Or check http://www.lcdwiki.com/3.5inch_RPi_Display
Above display’s i’ve used for Picore Players and the Lidar POC
To try: Getting above display running with a arduino https://github.com/PaulStoffregen/XPT2046_Touchscreen
Raspberry HDMI display
Easiest of them all, just connect with HDMI, there is a adaptor for hdmi-hdmi (versions 1,2,3) and hdmi-mini-hdmi for RPi4 variants.
Epaper and 7-Segment displays
Other means of displaying information are for example
Epaper
ESP with epaper module, disconnected power for a while, artifacts appear.
7 Segment displays
I used a lot of 7-Segment display’s in the past. They look cool and are hardcore.
My homebrew computer uses this
Nixie tubes!
And there are https://en.wikipedia.org/wiki/Nixie_tube .. I’ve never had those
Above bigger 2D display i used with Wled and a digital microphone, so its sound reactive. The lower part i got in recently .
I made a sound mixer controller for my applications, a while ago.
Some arduino project laying around on my desk. (OBS controller, Mqtt-sound-and-display-with-mute-acknowledge-button and Octoprint monitor, below that my dusty mixer)
I’m probably make a V2 with new functionality:
Switching applications which are using sound from speakers to headset and vice versa.