Ok,
We have pin#'s 1-12 on the I/O port.
Pin 1 is ground -
Pin 10 is +9V
Pin 11 is +9v
Is there a poke to turn on/off pin 10 and 11.
As to turning on and off as switch.
Also there is pin 2 +5VDC
So ground is - and voltage pins are +.
Can these be used to turn on/off relay switches?
That work with 9V AC. or a 5V DC relay.
If so I have 3 relays to turn on/off computer circuits built on a breadboard that has a plug to the i/o.
I/O port
Moderator: Moderators
first off, i am no expert, but i do enjoy playing around with the user port and connecting the vic to all kinds of things, so here are my two cents...
i don't think you can poke 10 and 11 on/off. from pg.229 of the prog. aid, Pin #10 is connected directly to the vic transformer.
i have used the user port to turn on/off devices on a breadboard etc.. but i have not attempted to turn on/off the power directly, as you seem to be eluding to.
i do use the +5V from the vic to power up the breadboard, but to turn on/off components on the board, i use the lines from PB0 to PB7, and peek and poke their respective locations to get the desired effect.
i don't think you can poke 10 and 11 on/off. from pg.229 of the prog. aid, Pin #10 is connected directly to the vic transformer.
i have used the user port to turn on/off devices on a breadboard etc.. but i have not attempted to turn on/off the power directly, as you seem to be eluding to.
i do use the +5V from the vic to power up the breadboard, but to turn on/off components on the board, i use the lines from PB0 to PB7, and peek and poke their respective locations to get the desired effect.
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
Re: I/O port
First, what comes out of pins 10 and 11 of the user port is NOT +9V. Each are opposite phase of the 9VAC coming in from the power supply and they can't be controlled in any way by the VIC except by turning it on or off using the power switch.Devlin wrote:Ok,
We have pin#'s 1-12 on the I/O port.
Pin 1 is ground -
Pin 10 is +9V
Pin 11 is +9v
Is there a poke to turn on/off pin 10 and 11.
As to turning on and off as switch.
Also there is pin 2 +5VDC
So ground is - and voltage pins are +.
Can these be used to turn on/off relay switches?
That work with 9V AC. or a 5V DC relay.
If so I have 3 relays to turn on/off computer circuits built on a breadboard that has a plug to the i/o.
A plain answer to your question is: Directly, no.
However, there are optical devices which could be used as relays and driven by lines PB0-PB7.
And at an immediate glance like this, what I would personnally favor to directly drive a relay if I wanted an ultra low cost solution to turn on and off a high power device using a relay would probably be the cassette motor line.
Physically, this is pin 3 of the cassette port. This is accessed at $911C (decimal 37148) bits 1-3.
PB0 To PB7
Ok,
So +5V Great.
What is the poke numbers to turn off or on the +5V.
Also how does PB0 to PB7 work as switches are there pokes used
to turn on/off them?
So what pin can I use for the - and + connection to open and close a circuit? via PB0 to PB7. using them as switches.
Please let me know.
So +5V Great.
What is the poke numbers to turn off or on the +5V.
Also how does PB0 to PB7 work as switches are there pokes used
to turn on/off them?
So what pin can I use for the - and + connection to open and close a circuit? via PB0 to PB7. using them as switches.
Please let me know.
I doubt you can turn off a power line by software, no matter if it is a pin in the user port, in the audio/video port, in the cartridge port or in the joystick port.
Worth noting is that the C64 userport has slightly different pinout than the VIC-20. Many applications might work, but in particular one that would use pins 10,11 (+9V here) might be fried if used with wrong computer?
Worth noting is that the C64 userport has slightly different pinout than the VIC-20. Many applications might work, but in particular one that would use pins 10,11 (+9V here) might be fried if used with wrong computer?
Anders Carlsson






- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
Re: Devices
As VicUser mentioned, the lines on the bottom of the user port, PB0-PB7 are truly the easiest to control.Devlin wrote:I just wanna turn on/off devices that I make myself on a breadboard.
So Relay Switch Idea is off.
Help here please.
These are lines C-D-E-F-H-J-K-L. Only one of two things can come out of these lines: 0Volts or 5Volts. But they can all be used as inputs or outputs.
To control devices using these lines, you must first all set them to output mode. Address 37138 is the Data Direction Register for all these 8 lines.
Poke 37138,255 sets all PB0 to PB7 to output.
The 8 lines of the port itself are located at 37136. You PEEK it to read an INPUT or POKE it to set an OUTPUT.
Lets say you want to have lines PB0-PB2 to output 5V, PB3-PB5 to output 0V and PB6-PB7 to output 5V then you want bits of address 37136 like this:
Bit#: 7 6 5 4 3 2 1 0
Value: 1 1 0 0 0 1 1 1
You then calculate the sum of 2^(bit number). In this case 2^7+2^6+2^2+2^1+2^0=199 so, POKE37136,199 will give the desired result, assuming you first POKE37138,255
Remember these lines are NOT buffered. Directly powering a device with that could fry the 6522. I suggest you use a simple TTL chip like a 74ls04 or 74ls14 to buffer these lines. However, these invert the signal and that must be taken into account when calculating what you POKE into 37136. All zeros become ones and vice-versa.