UBB Store


C=GPIO 32-bit Commodore Userport General Purpose I/O Expander for C64 and VIC-20 For Sale


C=GPIO 32-bit Commodore Userport General Purpose I/O Expander for C64 and VIC-20

This item has been viewed 334 times.

C=GPIO 32-bit Commodore Userport General Purpose I/O Expander for C64 and VIC-20:
$39

Listed is the all new: C=GPIO A 32-bit Commodore Userport General Purpose I/O Expander by Dorktronic.

C=GPIO gives you 32 digital I/O with added BASIC commands to control your DIY eletronics projects!

This brand new USERPORT EXPANSION BOARD for the Commodore 64 and VIC-20 adds 32 individually addressed Input/Output pins for use with your 5 volt compatible external hardware projects.

NOTE: Each board has been assembled by me and tested on my VIC-20.

BOARD FEATURES:
  • 32 digital GPIO (General Purpose Input Output) connections.
  • Hearty screw terminals for more robust projects.
  • Optionally use an external power connection with 5V regulator for higher milliamp loads.
  • A computer power detection circuit, which powers down C=GPIO when your computer is turned off.
  • Each connection can be individually set as an input or output.
  • Easily activate internal pullup resistors for reading switches.
  • An easy to learn BASIC Wedge adds commands to BASIC and makes the C=GPIO easy to control projects where speed isn’t an issue.
  • Compact Machine Language routines (256 bytes) are included for faster access to the C=GPIO.
TECHNICAL DETAILS

The C=GPIO uses two I2C GPIO expander chips. Your Commodore sends I2C signals out the user port on PB0 and PB7.

SOFTWARE NEW BASIC COMMANDS!

This downloadable BASIC Wedge adds the exclamation point (!) as a new command to BASIC.

C64 Version

LOAD "C64_GPIO.PRG",8,1 SYS 49152

VIC-20 Version

The VIC-20 version is setup for cartridge. But if you want to load it in from disk or tape, use SYS 40969 to start. You must have a RAM expansion enabled at $A000 in order to load from disk/tape.

These are available on Dorktronic's Github. You'll need to Google it, because no longer allows external links!

Here’s how it works:

Use: !{Port(0-31)},{Command(0-5)} to control a port.
!0,2 : REM SET PIN 0 TO OUTPUT MODE !0,0 : REM SET PIN 0 TO LOW (0V) !7,1 : REM SET PIN 7 TO HIGH (5V) !5,3 : REM SET PIN 5 TO INPUT MODE Use: !{Port(0-31)} to read a port. PRINT !5 : REM PRINTS 0 IF PIN 5 IS LOW, OR 1 IF IT IS HIGH P = !5 : REM SET VAR 'P' TO THE VALUE OF PIN 5 (0=LOW, 1=HIGH) PORT COMMANDS Cmd Description 0 Set output pin to LOW (0V) 1 Set output pin to HIGH (5V) 2 Set pin mode to OUTPUT 3 Set pin mode to INPUT 4 Turn off pin pullup resistor 5 Turn on pin pullup resistor ERROR MESSAGES
  • ?I2C BUS ERROR – Cannot find the C=GPIO, make sure it is plugged in.
  • ?BAD PORT ERROR – An incorrect port number was used, use 0 to 31
  • ?BAD CMD ERROR – An incorrect command number was used, use 0 to 5
EXAMPLE PROGRAMS Example 1: BLINK LED CONNECT AN LED TO C=GPIO: [PA0]--[+LED-]--[220Ω]--[GND] 10 !0,2 : REM SET PIN 0 TO OUTPUT 20 !0,1 : REM TURN ON LED 30 !0,0 : REM TURN OFF LED 40 GOTO 20 Example 2: TURN ON LED FOR ABOUT 5 SECS AFTER BUTTON PRESS CONNECT A BUTTON AND LED TO C=GPIO: [PA0]--[+LED-]--[220Ω]--[GND] [PA1]--[BUTTON]--[GND] 10 !0,2 : REM PIN 0 OUTPUT MODE 20 !0,0 : REM PIN 0 SET LOW (LED OFF) 30 !1,3 : REM PIN 1 INPUT MODE 40 !1,5 : REM PIN 1 ENABLE PULLUP 50 IF !1=1 GOTO 50 : REM WAIT FOR BUTTON 60 !0,1 : REM TURN ON LED 70 T = TI + 60 * 5 : REM 5 SECS FROM NOW 80 IF TI < T GOTO 80 : REM WAIT 90 !0,0 : REM TURN OFF LED 100 GOTO 50 PORT MAP Board BASIC PA0 - PA7 0 - 7 PB0 - PB7 8 - 15 PC0 - PC7 16 - 23 PD0 - PD7 24 - 31 COMPACT MACHINE LANGUAGE ROUTINES!

I have also written some size optimized I2C machine language routines.

Again, this is available on Dorktronic's Github. You'll need to Google it, because no longer allows external links.

IMPORTANT

Be sure to turn off your Commodore before inserting or removing the device, as you would do for any other cartridge or peripheral.

SUPER IMPORTANT!

The polarity of the power supply jack is tip-positive, ring-negative. BE VERY SURE TO HAVE YOUR POWER SUPPLY ORIENTED THIS WAY OR YOU MAY CAUSE DAMAGE TO YOUR COMPUTER.

DISCLAIMER

WHILE THIS ITEM HAS BEEN TESTED ON MY PERSONAL VIC-20, IT IS PROVIDED WITHOUT ANY GUARANTEES OR WARRANTY. YOU ARE SOLELY RESPONSIBLE FOR ANY AND ALL DAMAGES TO YOU OR YOUR PROPERTY. I AM NOT RESPONSIBLE FOR ANY TECHNICAL SUPPORT.

Please message me if you have any questions!

Here is a type-in listing for the C64 version, if you don't have a way to load the .PRG files

0 GOTO 100 5 DATA 56 10 DATA "KAMCKJFMCABOKLKJJDINAIADCE" 11 DATA "KJMAINAJADKJPEINAKADKJMAMG" 12 DATA "INALADKCALKJAAJNJDACMKNAID" 13 DATA "PKKJPPINJEACINJHACINJKACJH" 14 DATA "INJNACGAABACAEAIBACAEAIACC" 15 DATA "BCBCAAAAAMAMAAAAABABACACGE" 16 DATA "PPPPADADAEAEAFAFPPPPAGAGIE" 17 DATA "AHAHAIAIPPPPAJAJAKAKALALNM" 18 DATA "PPPPCAJLLHIKBAABGAMJCAJAMA" 19 DATA "AHKJHNKAMCEMGJKECJAHKILJDJ" 20 DATA "DEMAIFPKOABAJAADKJECCMKJOP" 21 DATA "EAIFPLIKCJBIIFPJIKEKEKEKGA" 22 DATA "CJABGACAHDAAAIMJCBPAAECIIL" 23 DATA "EMOHKHCICAGCMABAADEMDAMBBP" 24 DATA "IFPNCAPNKOCAJOLHOAAGJAAHFO" 25 DATA "KJIOKAMCEMGJKEKFPNBNDMMAAL" 26 DATA "IFPNIKCJABNABBIKAFPJKILOBA" 27 DATA "ECMAKFPKEJPPDNJDACEMOEMALL" 28 DATA "IKAFPJKILOECMAKFPKBNJDACPM" 29 DATA "JNJDACIFPOHICAIEMBCADEMCKE" 30 DATA "FIEMKOKHKFHKEIKFHLEICAHDPP" 31 DATA "AAMJCBPAAJGIIFHLGIIFHKEMPN" 32 DATA "IGKOGIGICAGCMABAADEMFAMBLD" 33 DATA "ANDMMAIFPNHICAIEMBCAEDMCEA" 34 DATA "FIKFPOCFPKPAADKAABCEKIKJGD" 35 DATA "AAEMJBLDIKCJHPIFPLCAPNKOHA" 36 DATA "CAJOLHIGPNCAPNKOCAJOLHIGCO" 37 DATA "POHICAIEMBCADEMCFIEMKOKHBI" 38 DATA "IKCJHPIFPLCAPNKOCAJOLHIGJA" 39 DATA "PNHICAIEMBCAEDMCFIKEPOKJDC" 40 DATA "AAEMJBLDKJDPCMKJPOCNADNNIK" 41 DATA "INADNNGAKJIACMKJABANADNNED" 42 DATA "INADNNGAKJAAINABNNINADNNJB" 43 DATA "CAGMMBCAHLMBKCAECAKLMBMKDG" 44 DATA "NAPKGACAGPMBCAGMMBCAHIMBFG" 45 DATA "CAHLMBCAGMMBGACAHIMBCAGPEH" 46 DATA "MBCAGMMBGAIFPMKCAICEPMDADA" 47 DATA "AGCAHIMBEMMGMBCAGMMBCAGPDO" 48 DATA "MBCAHLMBAGPMMKNAOICAGMMBCM" 49 DATA "GAKCAICAGPMBKNABNNCKCGPMFN" 50 DATA "CAHLMBMKNAPBCAGMMBKFPMGAJC" 51 DATA "CAHIMBCAGPMBCAHLMBCAGMMBOE" 52 DATA "GAKCAAKAAACAGMMBCAGPMBMKON" 53 DATA "PAAJCMABNNDAPICAHLMBGAIIFM" 54 DATA "NAPBCAKLMBGIGIKJGNKAMCEMDN" 55 DATA "GJKECAJLMBKFPLCJPOCALFMBCD" 56 DATA "CAPJMBKFPNCALFMBCAPJMBGAGP" 57 DATA "CABOMCKFPOCALFMBCAPJMBCAKC" 58 DATA "KLMBGACABOMCCAJLMBKFPLAJJD" 59 DATA "ABCALFMBCAPJMBCANFMBIFPODN" 60 DATA "CAKLMBGAANEDDNEHFAEJEPCAAF" 61 DATA "EFEOEBECEMEFEEANAADPEJDCLH" 62 DATA "EDCAECFFFDCACAEFFCFCEPFCMO" 63 DATA "AADPECEBEECAFAEPFCFECACAHJ" 64 DATA "EFFCFCEPFCAADPECEBEECAEDGM" 65 DATA "ENEECACAEFFCFCEPFCAAAAAAMH" 100 RESTORE:AD=49152:SM=0 110 READN:FORI=1TON:READR$:C=24 120 FORJ=1TOC STEP2:H=ASC(MID$(R$,J,1)) 130 L=ASC(MID$(R$,J+1,1)) 135 B=((H-65)AND15)*16+((L-65)AND15) 140 SM=(SM+B)AND255:POKEAD,B:AD=AD+1 150 NEXTJ 160 H=ASC(MID$(R$,J,1)) 170 L=ASC(MID$(R$,J+1,1)) 180 CK=(H-65)*16+(L-65):IFCK<>SM GOTO200 190 NEXTI:?"SUCCESS!":END 200 ?"ERROR ON LINE: ";(I+9) RUN SAVE"GPIO",8 SYS 49152

Buy Now


Other Related Items:



C64c Cream SD2IEC Commodore 1541 Disk Drive Emulator SD Card Reader C64 C128 VIC
C64c Cream SD2IEC Commodore 1541 Disk Drive Emulator SD Card Reader C64 C128 VIC


Gotek ADF Floppy Drive Emulator + 16GB USB Stick for Amiga: 500/600/1200/4000
Gotek ADF Floppy Drive Emulator + 16GB USB Stick for Amiga: 500/600/1200/4000


COMMODORE C64 / 128 / VIC 20 VIDEO TV A/V LEAD - OFC CABLE
COMMODORE C64 / 128 / VIC 20 VIDEO TV A/V LEAD - OFC CABLE


Beige SD2IEC Commodore 1541 Disk Drive Emulation SD Card Reader Vic20 C128 C64
Beige SD2IEC Commodore 1541 Disk Drive Emulation SD Card Reader Vic20 C128 C64


Commodore 64 128 C64 C64C Super Video AV Adapter - S-Video Composite & 2ch Audio
Commodore 64 128 C64 C64C Super Video AV Adapter - S-Video Composite & 2ch Audio


divMMC Future - JUMPERLESS SD Card Interface Sinclair ZX Spectrum - BUILT in UK
divMMC Future - JUMPERLESS SD Card Interface Sinclair ZX Spectrum - BUILT in UK


Commodore Cortex Emulator +16GB Stick for Amiga Disk 500/600/1200/2000/3000/4000
Commodore Cortex Emulator +16GB Stick for Amiga Disk 500/600/1200/2000/3000/4000


GGLABS CGA2RGB Commodore/PC digital to analog RGB converter C128 DAC CGA/EGA/MDA
GGLABS CGA2RGB Commodore/PC digital to analog RGB converter C128 DAC CGA/EGA/MDA


COMMODORE AMIGA 500, 600, 1200, 4000, NEW RGB 2 METRE SCART TV CABLE
COMMODORE AMIGA 500, 600, 1200, 4000, NEW RGB 2 METRE SCART TV CABLE