Tag Archives: electronics

Raspberry Pico with st7789v2 display 3D control

While ordering components for a mini C64 project I’m doing with my friend Bigred, I ordered a cheap ST7789-v2 display.

I want to make a generic pico gadget with a display, buttons and sound.
This to make a mini device for writing micropython demos.

The 3 tactical buttons are controlling the X,Y and Z axis of the rotating Cube.

Pinout:

PICODISPLAY
GP2Tactical switch (other side to 3v3)
GP3Tactical switch (other side to 3v3)
GP4Tactical switch (other side to 3v3)
GP9CS1
GNDGND
3v3VCC
GP18SCL (SPI clock)
GP19SDA (MOSI / SPI Data)
GP20RES (reset)
GP17DC (data command)
GP16BLK (backlight)

I know it says SCL/SDA (i2c) but it’s SPI controlled.

Used library : https://github.com/russhughes/st7789_mpy/tree/master

Some 3D explanation I drew a long time ago.

Using python you can use the Math funtions. (sin/cos)
Note: these are in radians!
print(math.sin(math.radians(30))) # 30 degrees

When using MachineCode you can use lookup tables.
These are generated tables which hold precalculated sin data for every degree.
You don’t have to use both cos and sin! (these are just 90 degrees shifted!)

Erik and I used a little basic program to generate an ASM include file like this

Costab LABEL BYTE
DB 0B4h,0B4h,0B4h,0B4h,0B4h,0B3h,0B3h,0B3h,0B2h,0B2h,0B1h,0B1h,0B0h,0AFh,0AFh
DB 0AEh
DB 0ADh,0ACh,0ABh,0AAh,0A9h,0A8h,0A7h,0A6h,0A5h,0A4h,0A2h,0A1h,0A0h,9Eh,9Dh,9Bh
DB 9Ah,98h,96h,95h,93h,91h,90h,8Eh,8Ch,8Ah,88h,86h,84h,82h,80h,7Eh
DB 7Ch,7Ah,78h,76h,74h,72h,70h,6Eh,6Ch,69h,67h,65h,63h,61h,5Eh,5Ch
DB 5Ah,58h,56h,53h,51h,4Fh,4Dh,4Bh,48h,46h,44h,42h,40h,3Eh,3Ch,3Ah
DB 38h,36h,34h,32h,30h,2Eh,2Ch,2Ah,28h,26h,24h,23h,21h,1Fh,1Eh,1Ch
DB 1Ah,19h,17h,16h,14h,13h,12h,10h,0Fh,0Eh,0Dh,0Ch,0Bh,0Ah,09h,08h
DB 07h,06h,05h,05h,04h,03h,03h,02h,02h,01h,01h,01h,00h,00h,00h,00h
DB 00h,00h,00h,00h,00h,01h,01h,01h,02h,02h,03h,03h,04h,05h,05h,06h
DB 07h,08h,09h,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh,10h,12h,13h,14h,16h,17h,19h
DB 1Ah,1Ch,1Eh,1Fh,21h,23h,24h,26h,28h,2Ah,2Ch,2Eh,30h,32h,34h,36h
DB 38h,3Ah,3Ch,3Eh,40h,42h,44h,46h,48h,4Bh,4Dh,4Fh,51h,53h,56h,58h
DB 5Ah,5Ch,5Eh,61h,63h,65h,67h,69h,6Ch,6Eh,70h,72h,74h,76h,78h,7Ah
DB 7Ch,7Eh,80h,82h,84h,86h,88h,8Ah,8Ch,8Eh,90h,91h,93h,95h,96h,98h
DB 9Ah,9Bh,9Dh,9Eh,0A0h,0A1h,0A2h,0A4h,0A5h,0A6h,0A7h,0A8h,0A9h,0AAh,0ABh,0ACh
DB 0ADh,0AEh,0AFh,0AFh,0B0h,0B1h,0B1h,0B2h,0B2h,0B3h,0B3h,0B3h,0B4h,0B4h,0B4h
CosTabE LABEL BYTE


Basic:
0 DEF SEG = &H7000: c = 0
1 pi = 3.14159265#
2 FOR x = 0 TO 2 * pi STEP 2 * pi / 256
3 d = COS(x) * 127 + 127
4 POKE c, d: c = c + 1: NEXT

Most i learned from a book called “Art of Graphics”
(This is image of the book from the internet, i don’t think I still got my copy somewhere.

A “new” sound chip for 6502

UPDATE: 20240225

I’ve written about General Instrument AY-3-8910 before, here is some work I did today.

This sound chip i wanted to implement in my amiga, and now it’s a alternative for my 6502 computer. ( As an alternative setup for the SID chip. )
Btw this is the same kind of chip used in the Atari ST.

A clean setup … I’ve got the sound chip and a Amplifier chip.

Above a Kicad drawing I made today, a little different from my design from the 90’s.

Below a movie clip I recorded today. Running a test setup using an Arduino nano and a sdcard reader.
The sound is bad, this is due to clipping and the absence of multiple resistors and capacitors.
Music is a register dump from a YM music file.
Amplifier is a bare LM386.

UPDATE: 20240225

I don’t like tying those three outputs together, and amplifying those.

So I’m going to use a LM324 i’ve got left from my 8085 interface, and make a 3-channel amplifier.

Something like this

SDK-85 interface PCB soldered

Using spacers, I can use the existing holes in the SDK to hold the interface PCB in place. Now I have to move my information sheet. 🙂

My scope didn’t save the test capture .. Next time.
But I could see the clear ones and zeros.

You can faintly see the data, stop start of a program is visible.

Dirk cleaned up a OCR version of the program, which I cleaned up some more, and found some errors.
So that should be okay now.

Flute note detection with leds

Yesterday I got my MAX9814 in, last night I got it working.
Used the leds from a lightpainter project to test controlling the leds.

Why is it, that it doesn’t matter how much components and ledstrips you buy, you alway need more.

First parts of the Scale, then a part of Farewell to Uist

Arduino Nano, using FastLeds library and FFT.
Ledstrip is WS2812, and the MAX8914 microphone

New Roms (eeprom)

Got some new roms in.
These are for my 8088/8086 the 6502 computer and C64 cartridges.

While I seldom had any problem writing to these, now I could not write one!
Erasing didn´t give me an error?!?

henri@zspot:~/projects/wozmon8088/mon8086$ minipro -w mon8086.rom -p AT28C64
Found TL866II+ 04.2.129 (0x281)
Warning: Firmware is newer than expected.
  Expected  04.2.128 (0x280)
  Found     04.2.129 (0x281)
Erasing... 0.02Sec OK
Writing Code...  9.57Sec  OK
Reading Code...  0.12Sec  OK
Verification failed at address 0x0001: File=0xAA, Device=0xFF

Whenever you get this, check the markings of the chip!

Mine are AT28C64b !!!!!!!!!!!

Change your command accordingly.
Another thing to watchout for is write protect, look at the commands

minipro -l | grep 28C64 
Found TL866II+ 04.2.129 (0x281)
Warning: Firmware is newer than expected.
  Expected  04.2.128 (0x280)
  Found     04.2.129 (0x281)
AM28C64A@DIP28
AM28C64A@PLCC32
AM28C64A@SOIC28
AM28C64AE@DIP28
AM28C64AE@PLCC32
AM28C64AE@SOIC28
AM28C64B@DIP28
AM28C64B@PLCC32
AM28C64B@SOIC28
AM28C64BE@DIP28
AM28C64BE@PLCC32
AM28C64BE@SOIC28
AT28C64
AT28C64@PLCC32
AT28C64@SOIC28
AT28C64B
AT28C64B@PLCC32
AT28C64B@SOIC28
AT28C64E
AT28C64E@PLCC32
AT28C64E@SOIC28
AT28C64F
AT28C64F@PLCC32
AT28C64F@SOIC28
CAT28C64A
CAT28C64A@PLCC32
CAT28C64A@SOIC28
CAT28C64B
CAT28C64B@PLCC32
CAT28C64B@SOIC28
XLE28C64A
XLE28C64A@PLCC32
XLE28C64B
XLE28C64B@PLCC32
XLE28C64B@SOIC28
XLS28C64A
XLS28C64A@PLCC32
XLS28C64B
XLS28C64B@PLCC32
XLS28C64B@SOIC28
28C64A
28C64A@PLCC32
28C64A@SOIC28
28C64AF
28C64AF@PLCC32
28C64AF@SOIC28
28C64B
28C64B@PLCC32
28C64B@SOIC28
UPD28C64
UPD28C64@SOIC28
KM28C64A
KM28C64A@PLCC32
M28C64
M28C64@PLCC32
M28C64@SOIC28
M28C64A
M28C64A@PLCC32
M28C64A@SOIC28
M28C64-xxW
M28C64-xxW@PLCC32
M28C64-xxW@SOIC28
M28C64
M28C64@PLCC32
M28C64@SOIC28
M28C64A
M28C64A@PLCC32
M28C64A@SOIC28
M28C64-xxW
M28C64-xxW@PLCC32
M28C64-xxW@SOIC28
X28C64

Laser XT/3 Bios

As posted before

I really like GlaBios for my 8088, so today I got my Laser XT/3 8086 machine from the attic.

Mmm TWO ROM’s thats interesting

Looking futher in the schematics I found this. Apparantly there is a 8K ROM configured in a D0-D7 + D8-D15 setup. (16 bits)

Found a technical manual, this is a excerpt.

In Turbo XT, there are two 28-pin sockets for ROM, one of them is
occupied by a 2764 which stored the BIOS (Basic Input Output System).
The other empty socket is used to house a 32K ROM, such as the BASIC
ROM

And about the XT/3 version which I have.

In Turbo XT /2 and Turbo XT /3, there are two 28-pin sockets for ROM,
both of them are occupied by 2764 which stored the BIOS. The contents
of the two 2764 are identical. One of them contribute the ODD Byte to the system and the other EVEN Byte. Together they support 16 Bit BIOS
access.

This could be an interesting chat with Greg ..

Meanwhile i’m going to look how to split a rom into odd/even.
Maybe i have to write a little python program for this.

Well, thats enough for today.

Lets fix my Cat S60 Flir phone, so i can track the hedgehog in our garden. (Battery replacement and powerbutton fix)

I fixed several phones before, (broken screen. touch not working). But I hate how some manufacturers build them.

Another logic probe

I’ve build a logic probe a while ago. (Mentioned here)

Today I got the EIStar LP-1. Its just a cheap easy probe, but does the job.
My version is only TTL and this one is TTL/CMOS (cmos is better when measuring arduino’s outputs)
TTL – Logic 1 = 4.75 -> 5V
CMOS – Logic 1 = more around the 3.3/3.7V

Only thing my version has which i’m missing is a pulse detector.
One millisecond puls gets clocked into a latch and keeps a led on.

Schematic I found (some similarities can be seen with my version)

From freeshell website

ISA prototyping board – IO chips

Followup on

UPDATE 20230702 20230703 20230714

While working on a Lidar project, my mouser components came in.

Now I have to find a IO address decoder schematic I made a while ago.

This ISA board is going to have a Wirewrapped setup. There is a 8255 IO chip, and uses 3x 74138 for IO address decoding, OR i will use a setup i’ve made for my 6502 using an atf22v10.

What to controll using this 8255? First some Leds, later a LCD display.

Below the 3 mentioned IC’s

The 8255 is a chip like the 6522 used in my DIY 6502 elsewhere on my site.

Overview of comparable IO chips. ( Not interchangeable due to bus timing!)
Most of them have 8 data lines and 2x 8 IO bi-directional lines.

CHIPNOTES
65226502 based machines
82558088/8068 based machines
Z84C2008Z80 (called PIO)
81558085 / 8088
852068000 amiga
68216800

6821 example

UPDATE 20230702

Started wirewrapping, luckily i’ve got a big choice of colors. That makes finding the right signals a breeze.

UPDATE 20230703

Found my schematic

Above uses 3 74138 decoders, address can be “programmed” using jumpers (not used on my prototype board) . Address 0400h in above example.

A15 – 0
A14,13,12 – decodes to OUT-0
A11 – 0
A10,9,8 – decodes to OUT-4
A7 – 0
A6,5,4 – decodes to OUT-0
A3 and A2 are not used (see note)
A1 and A0 are register select on the 8255

Address 0000,0100,0000,xxrr
xx can be a 0 or 1
the 8255 can be controlled using
0400h 0401h 0402h
but also
0404h 0405h 0406h
0408h 0409h ….
040Ch ……

UPDATE 20230714 – Alternative address decode test with ATF22V10

UPDATE 20230803

UPDATE

Miswired second 74138.
Tested with below code

mov dx,503h # control register
mov al,80h # output port a,b,c as standard IO/output
out dx,al # 16 bit IO mapped IO out
mov dx,500h # data register
mov al,0  # 0/ff all on/all off
out dx,al

Micro cassettes with computer programs.

I’ve got some micro cassettes with programs for P2000 and the Microtrainer (SDK-85).

Lets try to get this into executable code again.

(I sold my Philips P2000 last year before I found these tapes)

I bought a Cassette player (voice memo recorder) from Marktplaats (dutch ebay), and a mini jack cable (2.5mm to 3.5mm)

There are two things i’m going to try.

Converting the recorded audio into executable code using python or Puredata.
And making a print to connect the tape player to the SDK-85.

Connecting the player to a soundcard gave me:
Signed 16bit 44.1 kHz

(there are simular projects like this for C64 tapes and alike)
So there will be FFT tricks involved.

While browsing though this book:

I found this schematic: (page A1-39)

So that’s next to build