Controlling electronics with the Commodore 64 user port - Part 2

preview_player
Показать описание
The second part of a series where I explore the possibility to use the user port on an old Commodore 64 8-bit computer from the 80-s, to communicate with other electronic devices, self made or for example an Arduino device.

In this part I program the C64 using basic to turn on and off LED-lights

Electronicts kits I have purchased:
Рекомендации по теме
Комментарии
Автор

That last program can be done even easier in assembler (just wining it now :) )
LDA #255 ;set Port to output
STA 57579 ;userport control register as output
LDA #1 ;set A to 1
STA 57577 ; show 1 explicitly since we start loop with shifting
LoopUp:
ASL ;shift left (multiply by 2)
STA 57577 ; show led status
CMP #128 ; is value not 128 then LoopUp
BNE LoopUp
LoopDown:
LSR ;shift right
STA 57577 ;show led status
CMP #1
BNE LoopDown
JMP LoopUp
RTS

You could make the program even smaller if you branch on carry set and not set, instead of explicitly comparing the value and then branching. But this makes it a bit more readable for non-assembler coders.

And this runs ~1000 times faster than on basic.

rdoetjes
Автор

Good intro, I am just getting into electronics and retro computer, so I loved this.

Also, with that basic program you started showing at 12:30 I couldn't help but think back on the Venture Brothers "It's on, it's off, it's on, it's off" "That's called blinking, boys!"

robertsissco
Автор

In the first BASIC example it's quite funny that the pause loops with a value of 1000 actually eats up around a second of CPU time.

congestiontv
Автор

I used 8 SMD LEDs and wired all 8 lines and ground. I used 470 Ohm resistor network. Set (POKE) DDRB to 255 (all data lines are output). Sent (POKED) 170 and 85 alternately to CRB with a pause between. I used durexforth rather than BASIC. Posted to Instagram.

RalphWLundvall
Автор

also there is a possible to use a n-channel mosfet-transistor. with out consern for blowing the n n-channel transistor, the n-channel is a voltage-field controlled unit. it is controlled by positiv charge on N-channel-transistor gate.

transistorbaluba
Автор

It’s better to connect the LED (and resistor) to the collector of the NPN as you would steal 0.7 volts (forwarding voltage) of the transistor from the output. In this case it’s okay but with higher loads like relays you always switch them from the common collector. Just a little tip.

rdoetjes
Автор

Good stuff, brings back fond memories

raymondheath
Автор

salut ou avez vous acheté le fil vers user port a 1:26
hi where did you buy the wire to user port at 1:26

nancyroyer
Автор

Why do you use a transistor between the data line of the user port instead of connecting the data line to the LED directly? Usually I don't see a transistor used in a circuit like this.

System-
Автор

Please delete these videos until you have learned to do the electronics part properly and re-shoot those parts. Every broken CIA chip is a small tragedy.
Other than that, great stuff! I wish there was someone to tell me how easy the user port was to use when I was 10 years old.

Mustakari