VIC 20 as PC keyboard?

Basic and Machine Language

Moderator: Moderators

User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Richard James wrote:I have a question. What is the best way to have a commodore keyboard with the special keys, layouts and labels so that programming in VICE is easier and I can do things like see what C=Q and Shift-Q print. At the moment you can map the PC keyboard to something like the VIC-20 but without printing out labels for each key it is very hard to use.
...
I believe someone might already sell such labels.
Indeed someone does. I saw some at a recent Commodore Expo, they look quite slick. Here's the link:

http://www.4keyboard.com/index.php?main ... cts_id=141
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Those are great...but someone really messed up on the Commodore key logo there (maybe on purpose to avoid copyright infringement)?
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

Richard James wrote:given the VIC-20 has no A/D converter, or does it?
I suppose the tape interface is a 1-bit A/D converter; also the paddles interface is a 8 bit A/D though I have never seen it used as an audio sampler.

Transferring data via an audio channel reminds me of a (very lamer's) trick I used back in the Amiga days to transfer IFF pictures from my A500 to a VZ-500 (8bit). I had written a program on the Amiga that resized the picture to a lower resolution for the VZ500 and then "spoke" pixel hexadecimal codes via the BASIC "SAY" command. Then, on the VZ500, there was a human operated program that interpreted hex codes and draw them on the VZ screen. Another "Rube Goldberg" type of project :)
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

For some reason the guy that sells those stickers only shows a small piece of them. This is what they really look like:

Image

I've got a bunch of them kicking around here.
Last edited by gklinger on Wed Nov 26, 2008 2:03 am, edited 1 time in total.
In the end it will be as if nothing ever happened.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

@Gklinger:
I bought 10 of these last year.

The C= logo is messed a bit but i don't really mind.

The brackets have been replaced with an extra pair of () and that's just about the only thing I really don't like about these stickers.
Be normal.
brain
Vic 20 Nerd
Posts: 539
Joined: Sun Jul 04, 2004 10:12 pm

Post by brain »

nippur72 wrote:
Richard James wrote:given the VIC-20 has no A/D converter, or does it?
I suppose the tape interface is a 1-bit A/D converter; also the paddles interface is a 8 bit A/D though I have never seen it used as an audio sampler.
Paddles are ADCs, but very slow (1 sample every 512 cycles).

So, as long as you're OK with 800Bps (assuming 7 bits of precision), you can use the POT lines (I guess you could use both for 1600Bps). Remember, 0-5V in 256 increments.

Jim
Richard James
Vic 20 Devotee
Posts: 269
Joined: Mon Feb 04, 2008 6:06 am

Post by Richard James »

At that speed (1600bps) you could fill 3K in 14 seconds. Of course that does not include error checking and correction. The only problem is the amount of extra hardware to convert between the PC sound output and the VIC paddle inputs.
Change is inevitable except from a vending machine.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

eslapion wrote:The C= logo is messed a bit but i don't really mind.
Yeah, it is and it really bothers me. I've often thought about making up my own stickers with a Commodore-esque font a multi-coloured C= logo. I'll get round to it eventually.
In the end it will be as if nothing ever happened.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

brain wrote:Paddles are ADCs, but very slow (1 sample every 512 cycles).

So, as long as you're OK with 800Bps (assuming 7 bits of precision), you can use the POT lines (I guess you could use both for 1600Bps). Remember, 0-5V in 256 increments.
The VIC paddles are not really an ADC that operate by directly converting a voltage to a value.

Instead, they check how much time it takes to charge the capacitor in an RC system to a specific threshold voltage. Variations in the resistance change the charging period but the threshold voltage is always the same.

This type of system is very sensitive to noise (paddle jitter).

However, in theory, if you use the moment the VIC discharges the capacitor to restart the cycle, you can fool it into thinking the paddle has a very specific value by making a digital counter which will feed the VIC a voltage higher than the threshold after a specific amount of time.

AFAIK, this is how the 1351 mouse works on the 64. However, the VIC's paddle system has a different timing than that of the 64 and the 1351 does not work properly on the VIC.

Still, using a different timing, a similar system for paddles or other input devices with rock stable consistency could be implemented on the VIC.
Be normal.
brain
Vic 20 Nerd
Posts: 539
Joined: Sun Jul 04, 2004 10:12 pm

Post by brain »

eslapion wrote: The VIC paddles are not really an ADC that operate by directly converting a voltage to a value.
I claimed only that they are Analog to Digital Converters (ADC) and they are. They are a simplistic ramp-compare ADC, as noted on Wikipedia.
This type of system is very sensitive to noise (paddle jitter).
If you throw away the LSB and use only 7 bit of data, as I recommended in my post, you eliminate this issue.

Theory aside, it's very hard to implement the functionality in the 1351 Mouse. I've done it, but it requires a dedicated uC and tight coding. Since I never intended my original post to be a true recommendation (there are far better ways to send data to the VIC from the PC), I did not feel the need to provide any more detail.

Jim
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post by Leeeeee »

I claimed only that they are Analog to Digital Converters (ADC) and they are. They are a simplistic ramp-compare ADC, as noted on Wikipedia.
They're not even that clever. The pot inputs along with the associated capacitors C13 and C14 form the timing elements of two single shot monostables. It is this monostable timing that is measured.

Lee.
brain
Vic 20 Nerd
Posts: 539
Joined: Sun Jul 04, 2004 10:12 pm

Post by brain »

Leeeeee wrote:They're not even that clever. The pot inputs along with the associated capacitors C13 and C14 form the timing elements of two single shot monostables. It is this monostable timing that is measured.

Lee.
In ADC-speak, they fall into the ramp compare category, even though they don't function as a proper ramp-compare ADC. It's probably because they fit there the best (they are definitely not Flash or Sigma Delta ADCs. for example)

Jim
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post by Leeeeee »

They're not really ADCs. The nearest equivalent to the POT inputs is the Rext/Cext pin on a 74LS123 or similar. You can't call then ramp compare type because they're missing both the ramp and compare circuits.

The technique of using a gated timer is described in an app note conveniently titled "Measure resistance and capacitance without an A/D"

Lee.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

brain wrote:Theory aside, it's very hard to implement the functionality in the 1351 Mouse. I've done it, but it requires a dedicated uC and tight coding.
I thought it would be possible using a pair of cascaded 74LS161 or 74LS163 counters and a bit of surrouding electronics such as resistors, capacitors and transistor.

Back in 2003, I drew a simple schematic to create some sort of digital paddle for the VIC but I have since lost the piece of paper.
Since I never intended my original post to be a true recommendation (there are far better ways to send data to the VIC from the PC), I did not feel the need to provide any more detail.
I just picked up on your earlier post and my idea was rather "off topic" really.

True enough, there are much better ways to send data to the VIC. I just thought it would be great to finally have a true reliable and stable kind of paddle for the VIC.

I thought you might have experimented with that. ...off topic really...
Be normal.
brain
Vic 20 Nerd
Posts: 539
Joined: Sun Jul 04, 2004 10:12 pm

Post by brain »

Leeeeee wrote:They're not really ADCs. The nearest equivalent to the POT inputs is the Rext/Cext pin on a 74LS123 or similar. You can't call then ramp compare type because they're missing both the ramp and compare circuits.

The technique of using a gated timer is described in an app note conveniently titled "Measure resistance and capacitance without an A/D"

Lee.
Sigh...

What part of "Analog to Digital Conversion" do people not understand here? Anything that converts analog signals to digital is an ADC, regardless of how it accomplishes it.

As I stated, I don't feel they function as a proper ramp-compare ADC, but they fall into that category.

Jim
Post Reply