<omnitechnomancer>
For #3 I do not see why the glasgow should be involved...
<Darius>
yeah the glasgow doesn't have any analogue inputs (except voltage sensors I suppose)
Attie[m] has joined #glasgow
<Attie[m]>
mcc111: can you expand on your use case? are they digipots and/or with the centre tap connected elsewhere? (it's so, trivial)
<Attie[m]>
if you're looking for pots to provide an analog level to Glasgow, then you'll need ADCs somewhere... communicating with an Arduino could be as easy as using a UART, depending on what it is you want to say...
<omnitechnomancer>
My point about the arduino is most of them can appear to a computer as a serial port, you can then send your adc readings over that, I am unsure what benefir the glasgow gives in that case
<Attie[m]>
*if so, it's trivial (!)
<Attie[m]>
Indeed, if it's just about getting samples into a PC, then Glasgow isn't required... but if there's some realtime control / response / outputs, then it could be useful
<omnitechnomancer>
Yes that is what I wondered about.
<mcc111[m]>
<Attie[m]> "mcc111: can you expand on your..." <- they are analogue pots with 5V on one terminal and 0V on the other.
<mcc111[m]>
<omnitechnomancer> "My point about the arduino is..." <- I am considering using the glasgow to prototype a different device which will have an ICE40 at the center and access to 4 knobs on ADCs. so in this case the logic will all live on an fpga (because that is the characteristic of the hyptothetical next-stage device I am prototyping) and the only point of the arduino is to be a peripheral for the glasgow. (if I just wanted to connect
<mcc111[m]>
knobs to a PC, I have MIDI devices for that.)
<mcc111[m]>
* am prototyping),, * the PC will do nothing except flash the glasgow, and the
<mcc111[m]>
actually, i guess i could plug a MIDI device with knobs into the computer and have the computer process the MIDI forward the knob values to the glasgow. that might actually be easier.
<mcc111[m]>
<Attie[m]> "mcc111: can you expand on your..." <- btw— i am mainly a software person whose hardware experience is largely eyes-shut stumbling— i literally don't know what a "digipot" is. what is this, is it cheap, where can I buy a small lot (say, 16 or fewer)? would they likely have it at the electronics store the EE students at the nearby college shop at? I searched amazon and found only a mystery ASIC named "1PC X9259TS24"
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #glasgow
<Attie[m]>
apologies! "digipot" is a "digital potentiometer" ... i.e: the wiper is positioned by digital control (e.g SPI/I2C), rather than a physical movement
<Attie[m]>
in this case, if you were hoping to control the potentiometer from Glasgow, then that would likely be trivial...
<Attie[m]>
it sounds more like you want them as inputs - in which case an ADC will be required "somewhere". if you're only after 2x inputs, then Glasgow does have the Vsense pins, but I don't recall if they're available from the FPGA, or only really via the FX2 / Python (without much off-topic effort)
<mcc111[m]>
that sounds incredibly cool, the controllable potentiometer, but yeah, the opposite of what i want.
<Attie[m]>
if you have them, then MIDI knobs may be a better route for the proof-of-concept stage
<mcc111[m]>
i need exactly 4.
<mcc111[m]>
knobs, i mean. for the current project.
<mcc111[m]>
is there any chance AT ALL of glasgow connecting directly to USB midi? (i mean, not that getting the computer in the loop is a problem)
<Attie[m]>
oh... USB MIDI no, but basic MIDI probably yes!
<omnitechnomancer>
Yea regular MIDI is a UART with an atypical physical layer
<Attie[m]>
if MIDI is restricted to USB, then probably best to investigate I2C or SPI ADCs
<Attie[m]>
what sort of sample rate / resolution do you need?
<mcc111[m]>
<omnitechnomancer> "Yea regular MIDI is a UART..." <- everybody tells me if you want to connect 5DIN midi to breadboard hardware you need an optocoupler. maybe i just buy one of those?
<mcc111[m]>
<Attie[m]> "what sort of sample rate..." <- very low is fine I'm sure. like 60hz is probably even fine.
<Darius>
I ink you should step back a bit here
<Darius>
what are you trying to do?
<Darius>
you are saying you need ADCs for pots, but that is not necessarily true
<Darius>
for example you could use quadrature encoders
<Darius>
or you could use motorised faders
<mcc111[m]>
Darius: *deep breath* okay, this may be stepping back too far, feel free to laugh. but
<mcc111[m]>
This is the "Cassette Vision". It is kind of like the Japanese Atari 2600. It was the most popular console in Japan before the NES.
<mcc111[m]>
As you can see, it has four paddles built in.
<mcc111[m]>
I want to make a homebrew game for it.
<mcc111[m]>
That is going to be… a multistep process.
<Darius>
OK cool
<mcc111[m]>
The Cassette Vision had a very very weird architecture where there is no CPU in the box. The CPU was inside of the game cartridge. And I am mostly (but not completely) certain that at least two Cassette Vision games had no CPU and used pure transistor to transistor logic. (These two were ports of previously manufactured "TV game" systems by epoch).
<mcc111[m]>
So I think the most fun thing to do would be to wire an ICE40 into a fake cassette vision cart and run a pure-gateware video game.
<Darius>
heh neat
<mcc111[m]>
To prototype this, I intend to wire my amaranth into a CRT television (whitequark assures me I can do this via VGA) and make a small video game that outputs signals to the CRT. But for this to create a good simulacrum of the target system, I need something to stand in for the four paddles. To assist me in this I have: Windows and Linux PCs; a Korg NanoKontrol 2, with USB-MIDI and eight knobs; an Arduino with eight 7-bit ADCs on a
<mcc111[m]>
breadboard; and a small box of pure-analog potentiometers.. I do not currently own a soldering iron.
<mcc111[m]>
So I am trying to figure out how to get from A to B.
<mcc111[m]>
I think this is a very fun project and I have at least a 30% chance of getting all the way to the end of it successfully.
<Darius>
I suggest using quadrature encoders
<Darius>
they are purely digital and you can feed them into your logic
<mcc111[m]>
OK. How much would you expect four of those to cost, and whereabouts would I buy them (like, "local electronics store next to the University of Toronto", "aliexpress", "amazon"…)
<omnitechnomancer>
One thing you will want to answer with quadrature encoders though is does absolute input position matter to you or not
<Darius>
mcc111[m]: "a few bucks" and probably aliexpress, amazon, digikey, mouser, etc
<mcc111[m]>
omnitechnomancer: Not really, because this is a simulation and I don't need the gameplay to be 1:1 exact. But for this project it would be *nice* if the pots had firm "left" and "right" sides. Are quadrature encoders "continuous"?
<Darius>
quadrature encoders are usually free spinning
<omnitechnomancer>
quadrature encoders basically provide a signal that lets you detect steps and direction, but have no knowledge of where in the rotation they are
<mcc111[m]>
i definitely have situations that would be useful for me for!
<mcc111[m]>
thank you all for the help.
<omnitechnomancer>
Looking at schematics the 4 paddles on the Cassette Vision are quite strangely connected, the centre taps are all commoned together
<mcc111[m]>
oh , really
<mcc111[m]>
i… i don't know what that means actually. "taps"?
<mcc111[m]>
the cassette vision seems to have had a lot of strange decisions about it, some of which only made sense in a very short term sense at console launch. the RF output apparently has inverted voltage compared to every other console ever, which screws up connectivity with some modern devices. I think only one or two games every used the paddles at all, and later builds of the system removed them in favor of putting the four buttons in a
<mcc111[m]>
D-pad configuration
<mcc111[m]>
is it possible to get 4 unique simultaneous values out of the paddles?
<omnitechnomancer>
I think so, it appears that the common wiper connection and the ends of each pot are fed to the cartridge slot
<mcc111[m]>
hm, so that seems like i can get everything. but maybe at some positions i lose accuracy?
<omnitechnomancer>
Shouldn't cause problems, it will most likely just impact how you read them circuit wise
<mcc111[m]>
that's interesting, thank you
<omnitechnomancer>
For this you can possibly get away with a circuit that converts the potentiometer value into a pulse length and then measure that by counting in the FPGA
<mcc111[m]>
that sounds like something i could do
<mcc111[m]>
my problem is i took EE 201 but not EE 101¹ so I can reason about digital design quite clearly but anytime I have to think about *impedance* or *resistance* or any of those electrical properties i'm lost.
<mcc111[m]>
at some point i will either find the correct MIT courseware or sneak in to actual classes at the local university and correct this
<mcc111[m]>
¹ I blame bad advice from an advisor.
<mcc111[m]>
* my problem is i took EE 201 but not EE 101¹ so I can reason about digital design quite clearly but anytime I have to think about _impedance_ or _resistance_ or any of those electrical properties i'm lost.
<mcc111[m]>
at some point i will either find the correct MIT courseware or sneak in to actual classes at the local university and correct this
<mcc111[m]>
¹ I blame bad advice from a the college advisor.
<omnitechnomancer>
It appears that most of the carts tie two pins of the pots to VDD and then the remaining line (which is one end) to the microcontroller they used in the carts via a resistor
<Attie[m]>
it's an interesting design (and way of drawing the schematic)... if A3-7 are indeed all tied to VDD (looks like that's up to the cartridge), then the potentiometers are wired more like rheostats / variable resistor...
<Attie[m]>
B2-5 are then paired with a resistor (between pin and ground) on the cartridge to produce a potential divider
<omnitechnomancer>
Yes I believe it is up to the cart
<Attie[m]>
that's what you'll be measuring
<omnitechnomancer>
They are actually connected via a resistor to a capacitor to ground and the pin on the micro
<omnitechnomancer>
Which makes me think they are doing the timing the charage time of the capacitor method
<mcc111[m]>
<omnitechnomancer> "It appears that most of the..." <- Like, a resistor *inside* the cart. That's very funny
<omnitechnomancer>
The series resistor provides a minimum resistance if someone turns the pot hard against one end
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #glasgow
<chipb>
huh. what an odd console.
whitequark[cis] has joined #glasgow
<whitequark[cis]>
oh yeah that you could do digitally
WilfriedKlaebe[m has joined #glasgow
<WilfriedKlaebe[m>
Measuring the paddle knob positions is likely done by shortly tying PD1-PD4 to ground to empty those 22µF caps and then wait how long they need to reach some threshold voltage (VDD/2?) again.
<WilfriedKlaebe[m>
That's how PC Gameport joystick positions were found too.
<WilfriedKlaebe[m>
hinges on when a digital input flips from 0 to 1 on a voltage rising from GND to VDD...
<whitequark[cis]>
WilfriedKlaebe[m: we don't have schmitt triggers on inputs
<WilfriedKlaebe[m>
but that's something that can be found out experimentally
<WilfriedKlaebe[m>
could also just be done with calibration - measure time with knob fully left and then fully right
<WilfriedKlaebe[m>
ow, the times back then, when we had to regularly recalibrate joysticks.
<WilfriedKlaebe[m>
yep... still, the change will be somewhere, and that could be good enough.
<whitequark[cis]>
it should be fairly closely to the midpoint
_whitelogger_ has quit [Remote host closed the connection]
jstein has joined #glasgow
jstein has quit [Read error: Connection reset by peer]