{funny story] In 2019 i wanted to make a simple probe, which could detect 0 or 1 or a pulse. I wanted to make this on a little print using wirewrap wires and IC sockets. (I still have the tool which i used in the 90s.) When going to a well-known electronics shop in Den Hague. A great shop to get all kinds of oldskool electronics. But i’m getting ahead of the story. This shop has a lot of components for all kinds of electronics. New and what it looked like de-soldered component from boards or bought from old going-out-of-business shops or factories. Stuff you needed for 60s equipment. Well i was at the counter, asking a old guy. “Do you have wire-wrap wire” He said: ” No that’s old skool” …. {/funny story]
Latest wirewrap only a few years agoFrontToolsIn front the wirewrap sockets, I even had ZIF sockets (at the back) with long pins for wirewrapping.Ugly back from print
The wirewrap tool has a cable stripper. After stripping you would put a short part in the tool, place the tool over a IC pin and turning would wrap the wire on the pins. You could stack multiple connections on one pin. Removing could be done by turning the tool counterclockwise. Sometimes you had to remove the one closest to the print, replacing all wires. (Or cut the wrong/not needed wire and leave it in place … )
I’m thinking of moving my breadboard 6502 to a wirewrapped version. All my old boards are gone .. before i got a digital camera .. 🙁
Flashing ROMs .. (eeproms). It used to be a pain in the *$$. Burning took a looong time. But clearing one with UV took .. 20 minutes or so. Using one of these:
Altered clock module
Changed button press
Dipswitches for more speed control (red .. upper left)
Changed Rom/Ram
Changed addressing
Added RAM
ZIF Socket for ROM
VIC 6522
Fixed clock
Added buttons for interrupt
Display
Display works now
To test: Create Address logic to access display without VIA Can work, but not at high speed clock. Stays behind VIA
To buy: st7920 lcd 128×64
Generic improvements
Rewired most parts, using color codes (Blue data, Yellow Address and so on)
Added leds on data and address bus using ULN2803 darlington arrays
100nF Decoupling capacitors on the power rails
To do’s or ‘have to look into’s’
For sound i planned to use a General Instrument AY-3-8910, it is somewhere in my Lab, i know it is. I saved this chip and a SID for my Amiga addon soundcard. Where are my plans for the simple v1 setup? (FOUND IT)
I have to start writing rom functions for display usage. Like JSR $ff00 – Clear screen subroutine .. etc
I’m scraping information from websites, to get started on my clock controller. ATmega328 with ssd1306 display and rotary encoder/dip switches
Notes about the movie: Left side is Arduino IDE monitor reading Addressbus and Databus. (I’m going to try to rewrite this to realtime disassemble) Resetting system. Stepping CPU with manual clock pulses. Start vector being read at $FFFC/$FFFD. Program being run from $8000. Set clock on automatic ( ~ about 150 Hz ) Last opcodes you see a JMP loop 4C 2F 80, that is JMP $802F Display enlarged on video, was not visible on movie i took on mobile. (Wrong angle?)
Breadboard overview
Clock module
Reset module + Crystal
CPU + nmi/int buttons
RAM and ROM
Address decode + Bus divide
Addres/Data bus leds
6522 VIA + Display
2nd via + Buttons
?
(sound board)
TIL: 6502 can run without ram only rom,expect when using JSR … which uses a program stack in RAM
Cartridge printEeproms 8k and 32k (also for 6502 project)Eeprom programmer
I’ve got the tools and Bigred made me enthusiastic again. My goal is to make a C64 Cartridge from a PRG. And Not any program, it is the 8085 Emulator from Sepp.
Serveral problems i have to ‘fix’
The program is 17K, Cartridges can only be 16K. So i have to use 2x 8K and compress the data. This means it have to be uncompressed at start time. ( I was thinking of using exomiser for this )
Program starts normally at $0820 and probably is not optimised to run anywhere else. So a starting routine has to copy the program from cartridge memory to the correct location
Luckily i have the source! How cool is that
For version 4.73 it states : Starting at $0820 .. but my hexdump is off by one??!?
00000020 00 20 ec starts with 00 at $0020 .. and not 20 ?!?!
Tools used until now:
Vice – C64 Emulator x64 -cartcrt 8085.crt
c1541 – Linux disk tool for C64 images. Used this to extract the 8085emulator PRG
prg2crt.py – a convertor from PRG to a cartrid file which can be used by Vice python2 prg2crt.py 8085.prg 8085.crt
minipro – eeprom programming tool for Linux minipro -p AT28C64 -w /tmp/test.bin
cartconv (tool from vice to convert crt <-> bin) cartconv -t normal -i test.bin -n ‘my cart’ -o test.crt
xa – Cross assembler 65xx/R65C02/65816
ACME – the ACME Crossassembler for Multiple Environments
Memory Map C64 – source c64-wiki.com
Card Low starts at $8000, so that’s the place where those roms are going to be. To place on this address:
Copy routine : from ($8000 + this copy routine) to $0820 When to decompress?? jmp routine to $0820
A cartridge file >16K and with his emulation headers seems to work??!
Also nice: Magic Desk Cartridge Generator V3.0
UPDATE: 20220811
exomizer sfx 0x0820 8085.prg -o data.exo # Compress and start at 0x0820
xa frame.asm -o frame.bin # Add code and write binary
x64 --cart16 frame.bin # Test cartridge with Vice
frame.asm
;----------------------------------------------------------
; example usage
; xa frame.asm -o frame.bin
; cartconv -t normal -i frame.bin -n 'my cart' -o frame.crt
; x64 -cartcrt frame.crt
;----------------------------------------------------------
;no load-adress for bin-file, so no header here
*=$8000
.word launcher ;cold start
.word launcher ;warm start
.byte $c3 ;c
.byte $c2 ;b
.byte $cd ;m
.byte $38 ;8
.byte $30 ;0
launcher
stx $d016
jsr $fda3 ;prepare irq
jsr $fd50 ;init memory
jsr $fd15 ;init i/o
jsr $ff5b ;init video
;make sure this sets up everything you need,
;the calls above are probably sufficient
ldx #$fb
txs
;set up starting code outside of cartridge-area
move_starter
ldx #(starter_end-starter_start)
loop1
lda starter_start,x
sta $100,x
dex
bpl loop1
jmp $100
;---------------------------------
starter_start
ldx #$40 ;64 pages = 256 * 64 = 16384 Bytes
ldy #0
loop
src
lda exomized_data,y
dst
sta $801,y
iny
bne loop
inc src+2-starter_start+$100
inc dst+2-starter_start+$100
dex
bpl loop
;make sure settings for $01 and IRQ etc are correct for your code
;remember THIS table from AAY64:
; Bit+-------------+-----------+------------+
; 210| $8000-$BFFF |$D000-$DFFF|$E000-$FFFF |
; +---+---+-------------+-----------+------------+
; | 7 |111| Cart.+Basic | I/O | Kernal ROM |
; +---+---+-------------+-----------+------------+
; | 6 |110| RAM | I/O | Kernal ROM |
; +---+---+-------------+-----------+------------+
; | 5 |101| RAM | I/O | RAM |
; +---+---+-------------+-----------+------------+
; | 4 |100| RAM | RAM | RAM |
; +---+---+-------------+-----------+------------+
; | 3 |011| Cart.+Basic | Char. ROM | Kernal ROM |
; +---+---+-------------+-----------+------------+
; | 2 |010| RAM | Char. ROM | Kernal ROM |
; +---+---+-------------+-----------+------------+
; | 1 |001| RAM | Char. ROM | RAM |
; +---+---+-------------+-----------+------------+
; | 0 |000| RAM | RAM | RAM |
; +---+---+-------------+-----------+------------+
lda #$35 ;cart is always on instead of BASIC unless it can be switched off via software
sta $01
jmp $80d ;for exomizer, i.e.
starter_end
;----------------------------------
exomized_data
.bin 2,0,"data.exo"
;syntax for exomizer 2.0.1:
;exomizer sfx sys game.prg -o data.exo
main_file_end
;fill up full $4000 bytes for bin file ($c000-$8000=$4000)
.dsb ($c000-main_file_end),0
Exomiser info
Reading "8085.prg", loading from $0801 to $4CE9.
Crunching from $0801 to $4CE9.
Phase 1: Instrumenting file
-----------------------------
Length of indata: 17640 bytes.
[building.directed.acyclic.graph.building.directed.acyclic.graph.]
Instrumenting file, done.
Phase 2: Calculating encoding
-----------------------------
pass 1: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80273.0 bits ~10035 bytes
pass 2: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80039.0 bits ~10005 bytes
pass 3: optimizing ..
Calculating encoding, done.
Phase 3: Generating output file
------------------------------
Encoding: 1101112133423160,1122,2010223445667788,032144406789BBCD
Length of crunched data: 10034 bytes.
Crunched data reduced 7606 bytes (43.12%)
Target is self-decrunching C64 executable,
jmp address $0820.
Writing "data.exo" as prg, saving from $0801 to $304C.
Memory layout: |Start |End |
Crunched data | $07E7| $2F18|
Decrunched data | $0801| $4CE9|
Decrunch table | $0334| $03D0|
Decruncher | $00FD| $01C0| and $9F,$A7,$AE,$AF
Decrunch effect writes to $DBE7.
Decruncher: |Enter |During|Exit |
RAM config | $37| $37| $37|
IRQ enabled | 1| 1| 1|
UPDATE:20230126
; CODE COPY FROM http://www.lemon64.com/forum/viewtopic.php?t=60786&sid=2559442c8b963d7aac27cb13b493f372
; Thanks for posting: Richard of TND
; this is for a 16KB cart, using ACME!!
!to "mycart.crt",cart16crt
scr = $0400
DecrunchADDR = 2061 ;SYS 2061 (HEX $080D)
*=$8000
!word launcher
!word launcher
!byte $c3,$c2,$cd,$38,$30 ;CBM 80
launcher
sei
stx $d016
jsr $fda3 ;prepare irq
jsr $fd50 ;input memory
jsr $fd15 ;initialise i/o
jsr $ff5b ;initialise video memory
;For a more professional boot up. Make
;the border and screen black. AFTER
;the video memory, etc has finished.
lda #$00
sta $d020
sta $d021
cli
;Switch off the screen.
lda $d011
and #%11101111
sta $d011
;Move transfer code over to the screen
;memory.
ldx #$00
tloop lda transfer,x
sta scr,x
inx
bne tloop
jmp scr
transfer
ldx #$00
tr1 lda linkedgame,x ;Move from linked address
sta $0801,x ;Direct to BASIC start address
inx
bne tr1
inc scr+4
inc scr+7
lda scr+4
bne transfer
jsr $e453 ;load basic vectors
jsr $e3bf ;init basic ram
ldx #$fb
txs
;Execute the game, by jumping to the
;de-cruncher's start address.
;jmp $0820
jmp DecrunchADDR
;Link crunched game as a PRG file to memory after
;the cartridge build code.
linkedgame
!bin "8085sys.prg",,2
FileSize = *
!if FileSize >$c000 {
!error "FILE SIZE IS TOO BIG TO FIT 16KB CARTRIDGE"
} else {
*=$c000
}
Exomizer:
exomizer sfx sys 8085.prg -o 8085sys.prg
Reading "8085.prg", loading from $0801 to $4CE9.
Crunching from $0801 to $4CE9.
Phase 1: Instrumenting file
-----------------------------
Length of indata: 17640 bytes.
[building.directed.acyclic.graph.building.directed.acyclic.graph.]
Instrumenting file, done.
Phase 2: Calculating encoding
-----------------------------
pass 1: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80273.0 bits ~10035 bytes
pass 2: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80039.0 bits ~10005 bytes
pass 3: optimizing ..
Calculating encoding, done.
Phase 3: Generating output file
------------------------------
Encoding: 1101112133423160,1122,2010223445667788,032144406789BBCD
Length of crunched data: 10034 bytes.
Crunched data reduced 7606 bytes (43.12%)
Target is self-decrunching C64 executable,
jmp address $0820.
Writing "8085sys.prg" as prg, saving from $0801 to $304C.
Memory layout: |Start |End |
Crunched data | $07E7| $2F18|
Decrunched data | $0801| $4CE9|
Decrunch table | $0334| $03D0|
Decruncher | $00FD| $01C0| and $9F,$A7,$AE,$AF
Decrunch effect writes to $DBE7.
Decruncher: |Enter |During|Exit |
RAM config | $37| $37| $37|
IRQ enabled | 1| 1| 1|
exomizer sfx $\0801 8085.prg -o 8085out.prg
Reading "8085.prg", loading from $0801 to $4CE9.
Crunching from $0801 to $4CE9.
Phase 1: Instrumenting file
-----------------------------
Length of indata: 17640 bytes.
[building.directed.acyclic.graph.building.directed.acyclic.graph.]
Instrumenting file, done.
Phase 2: Calculating encoding
-----------------------------
pass 1: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80273.0 bits ~10035 bytes
pass 2: optimizing ..
[finding.shortest.path.finding.shortest.path.finding.shortest.pat]
size 80039.0 bits ~10005 bytes
pass 3: optimizing ..
Calculating encoding, done.
Phase 3: Generating output file
------------------------------
Encoding: 1101112133423160,1122,2010223445667788,032144406789BBCD
Length of crunched data: 10034 bytes.
Crunched data reduced 7606 bytes (43.12%)
Target is self-decrunching C64 executable,
jmp address $0801.
Writing "8085out.prg" as prg, saving from $0801 to $304C.
Memory layout: |Start |End |
Crunched data | $07E7| $2F18|
Decrunched data | $0801| $4CE9|
Decrunch table | $0334| $03D0|
Decruncher | $00FD| $01C0| and $9F,$A7,$AE,$AF
Decrunch effect writes to $DBE7.
Decruncher: |Enter |During|Exit |
RAM config | $37| $37| $37|
IRQ enabled | 1| 1| 1|
This looks okay: (monitor in vice)
Attaching crt in vice
Maybe one of these problems:
1) you CAN NOT use BASIC routines when a cart is inserted (without weird tricks, i.e.
storing BASIC routines on cart etc)
2) you need to be careful about $01 as you may map in ROM at $8000 without expecting it.
Please refer to this if in doubt:
http://unusedino.de/ec64/technical/aay/c64/memcfg.html
[3] You should also be careful about the usage of KERNAL routines as some of them
sweep across BASIC-code as well!
After a whole day soldering yesterday, ending up with a wire mess. Which didn’t work at the end…
Starting measuring some things, and create some test sketches (led blinky tests) I found out that the main problem was not having the red switches connected to GND. Blue switches where upside down, this was a easy fix. Because these are ON-ON switches, and where already connected to a common line. Then a mixup between D0 and D6 (wires crossed) And it is working! Made some lines and lettering on the frontplate after some playing around.
Sorting my fileserver i found a lot of Bash/Linux scripts maybe useful.
Some are tool usage only, maybe I’ll remove this page. But this being my own log/notebook, who knows
Port knocker .. opens port 22 when you send a tcp packet to port 1600 first. Note: when portscanning it wil close again when accessing 1601 or 1599. Note2: NOT active on my server .. duh!
(Open with a browser or telnet/netcat)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -m recent --rcheck --name SSH -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1599 -m recent --name SSH --remove -j DROP
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1600 -m recent --name SSH --set -j DROP
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1601 -m recent --name SSH --remove -j DROP
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP
Dump and share your log, you get a short link to share
Start in screen
Start screen in "detached" mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts.
/usr/bin/screen -d -m -S backup /usr/local/bin/backup.sh
screen -r backup
Screensize
ctrl-a :fix # Screensize fix
Memory leak check
pmap <pid> | tail -1
Memory leak .. pmap opslaan en vergelijken met een pmap later.
Listen to remote microphone local playback
ssh -C monitor@remoteserver arecord -f dat | aplay -f dat
Root login to named account
ssh-copy-id root@remote-server (one time only)
then:
ssh root@remoteserver
Lookup named account
cat /var/log/secure | grep publickey | cut -f6 -d: | while read ; do ssh-keygen -lf ~/.ssh/authorized_keys | grep $REPLY ;done
2048 SHA256:l85g/NvPnEy85UVfJ5LJw3NvPnEy85UVfJ5LJw3NvPnEy85UVfJ5LJw3 haanstoot@minka (RSA)
log into ovirt engine and postgres
psql -d engine -U postgres -c 'select vm_names,disk_profile_name,storage_id,disk_id,image_guid,disk_alias from public.all_disks;'
Gluster heal info
gluster volume info | egrep "Volume Name|Type" | grep -B1 Replicate | grep "Volume Name" | cut -c14- | while read ;do gluster volume heal $REPLY info > /tmp/$REPLY.out ; done
ls /tmp/*out | while read ;do cat $REPLY | grep entries | grep -v "Number of entries: 0" >/dev/null && echo $REPLY ;done | while read heal ; do cat $heal ;done | tac |sed -e '/Number of entries: 0/I,+1 d' | tac | uniq
Some work tips i’ve posted
VI
Vim comments
toevoegen
ga op de eerste regel van de te commenten regel staan
ctrl-v (visual)
naar beneden tot eind regel (met cursor of pagedown)
ctrl-i
#
esc (kan even duren)
verwijderen
ga op de eerste regel van de te uncommenten regel staan
ctrl-v (visual)
naar beneden tot eind regel (met cursor of pagedown)
x
esc
Als user config geedit en geen schrijfrechten?
:!bash
chmod 666 bestand
:wq
chmod bestand naar wat hij was
Input / verwerk door bash vanuit vi
:0,5 !sort # eerste 5 regels door sort heen halen
:r !date # datum in je tekst document
Vim tabs / multiple files
vi /etc/hosts /etc/services
:n
:prev
VIM7 tabs
vim -p /etc/hosts /etc/profile
:tabe /etc/services
:tabn
:tabp
Key mappen
:map <F7> :tabp <CR>
:map <F8> :tabn <CR>
zet deze in je $HOME/.vimrc ... zonder de eerste ":"
Vi redirect
:r date # datum in text
:1,5!sort -n # sorteren van eerste 5 regels met een extern commando (kan ook met shift v een visual gedeelte selecteren)
:0,$!cut -f1 -d: # alleen field 1 van text overhouden (delimiter :)
Vi inspringen bij loop code
selecteer met shift-v de regels die moeten inspringen.
daarna > of < gebruiken om te tabben
Speciale charakters met vi bekijken
:set list
een tab zier er dan uit als ^I
Bash
sudo vergeten in commando
service apache restart
sudo !!
Bash truck vorige commando
doet vorig commando met aangepast keyword
systemctl status ovirt-ha-broker.service
^status^start
{} expand
directory's archief30_tmp t/m archief35_tmp recursive directories chmod 2775 zetten
find achief{30..35}_tmp -type d -exec chmod 2775 {} \;
of
mkdir tmp{1..3}
echo pr{ut,utser}s
1 regel uit een script starten zonder copy-paste (bijvoorbeeld in een remote-console sessie)
grep ipa command uit cobber.ks en voor deze uit
( /usr/sbin/ipa-client-install --domain=mgtdomain --enable-dns-updates -w password --realm=domain --server=server.domain --hostname=hypervisor.domain --unattended --force-ntpd )
cat cobbler.ks | grep ipa | bash
Bash karakters omdraaien
Linkerhand rechterhand coordinatie probleem smile
upadte
ga op de d staan en druk ctrl-t
Bash laatste woord vorige regel
ls -latrd /var/data/extra/backup
chmod 775 <ESC(punt)>
Ssh forward bij een running sessie
[haanstoot@xxx202 ~]$
~C (tilde C)
-L8080:localhost:80 (redirect localhost port 80 naar eigen machine poort 8080
-D9999 (Dynamic socks forward, zie andere post in deze wiki)
CTRL-C werkt niet?
ctrl\
SSH .ssh/config
KeepAlive yes <---------- dont die on me
ServerAliveInterval 60 <---------- dont die on me
Host *.domain <-- voor alle hosts in radlan fast login en geen vraag over key
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
host *.domain <-- domain is altijd mijn user
user haanstoot
GSSAPIAuthentication no <-- speedup
host pruts*.domain
user pi
Parallel tasks
4 parallel jobs
find jpg -type f -name \*.jpg -print0 | xargs -0 -n1 -P4 ./convert.sh
clusterssh truck
clusterssh alle svgs <--- naar alle svgs
sudo su -
cd /bricks/*/store <--- cd naar deze als bestaat
cd /rhgs/brick0*/store <-- cd naar deze als bestaat (nu sta je in atelier directories als deze bestaat als root in de svgs)
pwd | grep store || logout <--- geen atelier dir waar je staat? dan logout
id | grep haanstoot && logout <-- net logout? dus eigen user ... dan logout
eindresultaat ... als root in atelier volumes op svgs waar ze bestaan
Start in screen
/usr/bin/screen -d -m -S backup /usr/local/bin/backup.sh
screen -r backup
Start screen in "detached" mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts.
Sudo vergeten
systemctl restart httpd (wil niet als user)
sudo !!
(doet "sudo systemctl restart httpd")
Reuse arguments
Bijvoorbeeld:
# touch file1 file2 file3 file4
# chmod 777 !*
Voert uit: chmod 777 file1 file2 file3 file4
5 meeste disk gebruikers human readable
du -hsx * | sort -rh | head -5
rm groot bestand duurt lang
: > /mappen2/archieven/test.img
Check memory bankjes
sudo dmidecode| grep -i -B1 "Form Factor" (B1 betekend BEFORE 1 regel meenemen, A is AFTER)
Size: 8192 MB
Form Factor: DIMM
--
Size: 8192 MB
Form Factor: DIMM
--
Size: No Module Installed
Form Factor: DIMM
--
Set time and restart NTP service
sudo service ntpd stop && sudo ntpdate ntp1.domain && sudo ntpdate ntp2.domain && sudo service ntpd start
Aliases en terminal kleuren
In een terminal f*ckedup colors?
komt door de alias
alias ls='ls --color'
deze even uitzetten / niet gebruiken?
\ls
Werkt voor alle aliassen
Snelle delete
Niet onderstaande gebruiken voor grote dirs
rm -rf /path/bla
Maar
mkdir /tmp/leeg ; rsync -a --delete /tmp/leeg /path/bla
Bash best practices
BashBestPractices
Script log replay
script --timing=/tmp/time.txt /tmp/script.log
scriptreplay -t /tmp/time.txt /tmp/script.log
There are toooo many cool sniplets .. only adding when i’m bored.
Loads of stuff on my main fileserver. (Graph is a great tool called DUC) https://duc.zevv.nl/
Besides a search engine, i have a file finder. Due to the massive amount of data, i like to find things by other means than knowing the directory structure.
I can find files by filename, but also by contents.
I’ll talk about find by contents first.
I’ve got loads of documents in Pdf, HTML, txt, doc, sheets , wordperfect etcetera. Those documents i can find using a tool named Namazu. This is quite a old tool, but i’m using it for a long time and it still works great. I didn’t find a better replacement yet. (But i’ve been looking into : elasticsearch, Solr, Lucene)
http://www.namazu.org/ is easy to install, but if you want the tool to scrape different kinds of documents you have to add some additional software.
My multipurpose printer can scan pages in pdf. Those are only embedded jpg’s in a pdf container. I will talk about how i handle these later.
My current start page : This index contains 267,763 documents and 14,036,762 keywords.
Search example of namazu
Some things to consider when implementing namazu:
tweak the file types to scrape, it makes no sense to scrape binaries
you can set a parameter in the config for search only, this disables downloading the found link in the results!
Before Namazu i used HtDig.
Screenshot htdig
HtDIg also can scrape remote websites, Namazu can’t.
Preparing PDF for indexing:
I’ve written some scripts to make PDFs containing scanned text scrape-able. ( https://gitlab.com/fash/inotify-scanner-parser ) What it does:
My scanner puts a scanned pdf on my fileserver in a certain directory
Inotify detects a written file
it will copy the file, run OCR on it (tesseract) and writes a txt file (scapeable)
After that the text will be embedded (overlay) on the PDF, so now it becomes searchable/scrapeable
When certain keywords are found, it will sort documents in subdirs
Example from a scanned jpg, i can find OCR words! (note .. the overlay is exact on the found words)
Finding files by name:
For finding files a made a little webpage like this:
It is a simple webpage grabbing through a list of files. It takes the first keyword and does a grep, it takes a second keyword to match also. I can select different file databases to search. (This case is private) Between search and private i can give the number of entries to print. So i can do Search “ansible” NOT “tower” 50 entries from the public fileset
The Altair 8800 is a microcomputer designed in 1974 by MITS and based on the Intel 8080CPU. Interest grew quickly after it was featured on the cover of the January 1975 issue of Popular Electronics and was sold by mail order through advertisements there, in Radio-Electronics, and in other hobbyist magazines.
(picture from wikipedia)
UPDATE: 20220804 – Added Octal sheet
I alway loved the simple setup of this computer. There was no screen and no keyboard. Only later additions to the machine provided these.
One explanation of the Altair name, is that the name was inspired by Star Trek episode “Amok Time“, where the Enterprise crew went to Altair (Six).
There are only a few differences between the used 8080 CPU and the 8085 CPU of a machine i learned machinecode on.
See : https://www.henriaanstoot.nl/1989/01/01/8085-machinecode-at-school/
So for a really long time i wanted to have a Altair alike machine. There are do it yourself kits for sale. Which look like perfect relica’s and there are virtual machines and emulators. But i wanted to have the feeling of throwing the switches. You can find a emulator here (https://s2js.com/altair/)
So i bought the components, a poker case which can hold the machine. And started building today.
The backend is a arduino based emulator, but with real leds and switches! (https://create.arduino.cc/projecthub/david-hansel/arduino-altair-8800-simulator-3594a6)
Components and pokercaseDrillingFirst looks
Next to do:
Fix plate into case
Solder a LOT of wires and components!
Shall i get rid off the transitors and use darlington arrays?
Put lettering on the aluminium plate : Functions and Bus information.
Build a power connector in the case
And then … programming 🙂
UPDATE: 20220804 – Added Octal sheet
The Altair is a octal based machine, but i couldn’t find a opcode list in Octal. So i generated one. When entering a MOV D,M instruction for example, you have to enter x 0 1 0 1 0 1 1 0 using the switches Thats 126 in octal but most tables are in hex ( MOV D,M is 56, which is 0101 0110 but not that clear on the switches)
Way back in 2018 i was playing around with i2c and touch.
CAP1188 Multi touch sensor
I remembered that VGA was using i2c to get information from monitors like brand/type and connection information.
I managed to access the cap1188 up to my Laptop via VGA.
2018 Schematic i used to abuse vga …
The final python code i used to play with the variables and playing sound i can’t find. But below is the test code
#!/usr/bin/python
# NOTE: i did a address scan, now i have 3v3 connected to AD, so probably the address is 0x28 !!
import smbus
bus = smbus.SMBus(1) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)
DEVICE_ADDRESS = 0x29
DEVICEx = 0x10
DEVICE_REG_MODE1 = 0x00
DEVICE_REG_LEDOUT0 = 0x1d
#Write a single register
bus.write_byte_data(DEVICE_ADDRESS, 0x1f, 0x3F)
#Write an array of registers
#ledout_values = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff]
#bus.write_i2c_block_data(DEVICE_ADDRESS, DEVICE_REG_LEDOUT0, ledout_values)
while True:
print bus.read_byte_data(DEVICE_ADDRESS,0x10), bus.read_byte_data(DEVICE_ADDRESS,0x11) , bus.read_byte_data(DEVICE_ADDRESS,0x12), bus.read_byte_data(DEVICE_ADDRESS,0x13), bus.read_byte_data(DEVICE_ADDRESS,0x14), bus.read_byte_dat
a(DEVICE_ADDRESS,0x15), bus.read_byte_data(DEVICE_ADDRESS,0x16), bus.read_byte_data(DEVICE_ADDRESS,0x17)
Today i connected the cap1188 to a ESP32 and a piezo buzzer.
ESP FuzzahBuzzerCAP1188CAP1188
/*** Based on below library ***/
/*** Changed pins and added sound ***/
/***************************************************
This is a library for the CAP1188 I2C/SPI 8-chan Capacitive Sensor
Designed specifically to work with the CAP1188 sensor from Adafruit
----> https://www.adafruit.com/products/1602
These sensors use I2C/SPI to communicate, 2+ pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_CAP1188.h>
const int TONE_OUTPUT_PIN = 26;
const int TONE_PWM_CHANNEL = 0;
int freq = 0;
// Reset Pin is used for I2C or SPI
#define CAP1188_RESET 9
// CS pin is used for software or hardware SPI
#define CAP1188_CS 10
// These are defined for software SPI, for hardware SPI, check your
// board's SPI pins in the Arduino documentation
#define CAP1188_MOSI 11
#define CAP1188_MISO 12
#define CAP1188_CLK 13
// For I2C, connect SDA to your Arduino's SDA pin, SCL to SCL pin
// On UNO/Duemilanove/etc, SDA == Analog 4, SCL == Analog 5
// On Leonardo/Micro, SDA == Digital 2, SCL == Digital 3
// On Mega/ADK/Due, SDA == Digital 20, SCL == Digital 21
// Use I2C, no reset pin!
Adafruit_CAP1188 cap = Adafruit_CAP1188();
// Or...Use I2C, with reset pin
//Adafruit_CAP1188 cap = Adafruit_CAP1188(CAP1188_RESET);
// Or... Hardware SPI, CS pin & reset pin
// Adafruit_CAP1188 cap = Adafruit_CAP1188(CAP1188_CS, CAP1188_RESET);
// Or.. Software SPI: clock, miso, mosi, cs, reset
//Adafruit_CAP1188 cap = Adafruit_CAP1188(CAP1188_CLK, CAP1188_MISO, CAP1188_MOSI, CAP1188_CS, CAP1188_RESET);
void setup() {
Serial.begin(9600);
Serial.println("CAP1188 test!");
ledcAttachPin(TONE_OUTPUT_PIN, TONE_PWM_CHANNEL);
// Initialize the sensor, if using i2c you can pass in the i2c address
if (!cap.begin(0x28)){
//if (!cap.begin()) {
Serial.println("CAP1188 not found");
while (1);
}
Serial.println("CAP1188 found!");
}
void loop() {
uint8_t touched = cap.touched();
if (touched == 0) {
// No touch detected
return;
}
for (uint8_t i=0; i<8; i++) {
if (touched & (1 << i)) {
Serial.print(touched); Serial.print("\t");
freq = (i * 100);
ledcWriteTone(TONE_PWM_CHANNEL, freq);
delay(100);
}
}
Serial.println();
delay(50);
}
Finding the right pins or above pinout was the hardest part. The sketch reads the pins binary so value 129 is first and last bit.
Now i have to get the sound sounding a little better and add frequencies and fingersettings to the sketch to get a minimal electronic bagpipe. (V3 it is .. )
Download from https://micropython.org/resources/firmware/esp32-20220618-v1.19.1.bin
Test with
screen /dev/ttyUSB0 115200
Enter import machine or help()
Great up and running
Now we have to install a boot loader Use ampy to list files
#list boot
ampy -p /dev/ttyUSB0 ls
/boot.py
#get boot.py
ampy -p /dev/ttyUSB0 get boot.py
vi boot.py (create new)
#import esp
#esp.osdebug(None)
#import webrepl
#webrepl.start()
def connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
sta_if.connect('WIFISSID', 'WIFIPASS')
while not sta_if.isconnected():
pass
print('network config:', sta_if.ifconfig())
Push the file
ampy -p /dev/ttyUSB0 put boot.py
Usage: ampy [OPTIONS] COMMAND [ARGS]...
ampy - Adafruit MicroPython Tool
Ampy is a tool to control MicroPython boards over a serial connection.
Using ampy you can manipulate files on the board's internal filesystem and
even run scripts.
Options:
-p, --port PORT Name of serial port for connected board. Can optionally
specify with AMPY_PORT environment variable. [required]
-b, --baud BAUD Baud rate for the serial connection (default 115200).
Can optionally specify with AMPY_BAUD environment
variable.
-d, --delay DELAY Delay in seconds before entering RAW MODE (default 0).
Can optionally specify with AMPY_DELAY environment
variable.
--version Show the version and exit.
--help Show this message and exit.
Commands:
get Retrieve a file from the board.
ls List contents of a directory on the board.
mkdir Create a directory on the board.
put Put a file or folder and its contents on the board.
reset Perform soft reset/reboot of the board.
rm Remove a file from the board.
rmdir Forcefully remove a folder and all its children from the board.
run Run a script and print its output.
Connect to serial console using screen
sudo screen /dev/ttyUSB0 115200
(use CTRL-A \ to exit)
Connect to wifi
import boot
connect()
Led blinky test, with below file named ledtest.py
import time
from machine import Pin
led=Pin(2,Pin.OUT) #Internal led pin
while True:
led.value(1) #Set led turn on
time.sleep(0.5)
led.value(0) #Set led turn off
time.sleep(0.5)
Upload and run script
ampy -p /dev/ttyUSB0 put ledtest.py
import ledtest (without .py!)
Next todo: boot.py @boot ?!? Run custom python after booting. Connect display and play with drawing.
Tip: Install rshell !
sudo pip3 install rshell
fash@zspot:~$ rshell
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
No MicroPython boards connected - use the connect command to add one
/home/fash> autoconnect: /dev/ttyUSB0 action: add
/home/fash> ?
Documented commands (type help <topic>):
========================================
args cat connect date edit filesize help mkdir rm shell
boards cd cp echo exit filetype ls repl rsync
Use Control-D (or the exit command) to exit rshell.
Connecting the display
I’ve connected the display as above. Note the different connections on the display. Above fritzing part has connections for touch screen! The 4 or 5 pins on the other side are for sdcard functionallity.
Now you can use the library by editing a example like demo_bouncing_boxes.py
Add and change
# At the beginning of the file
import setupmydisplay.py
Futher down comment two lines and add your own setup
# Baud rate of 40000000 seems about the max
#spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13))
#display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
display = setup.createMyDisplay()
Upload to ESP32 and testing!
ampy -p /dev/ttyUSB0 put demo_bouncing_boxes.py
ampy -p /dev/ttyUSB0 put setupmydisplay.py
# connect and start
sudo screen /dev/ttyUSB0 115200
import demo_bouncing_boxes.py
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.