Writing special purpose registers with base-16 100kohm potentiometers?
GreenDevil
Posts: 7
First the units of the potentiometer are in mΩ not kΩ. Sorry about the mistake I don't know how to change the Thread title yet.
The Green Devil wants to know;
How to hook a base-16 hex encoding potentiometer to an input on a propeller processor to write special purpose registers?
If 100mΩ is the right resistance range to write special purpose register assignments?
Also, Assuming 0 is 0mΩ and 1 is 6.666666666666667mΩ, 2 being 13.33333333333333mΩn and 3 being 20mΩ. . . of an input voltage.
What is the input voltage to write? 1.5 volts? And where is the input voltage found on the 32-bit range?
Doing some math I have the vmax and vmin in big endian and know the hex range for each bit. But I’m a little unclear on the ohm scale given 5mA per 8pins or 40mA per pin of 8 excluding pin 0-6.
This is the math I've been gathering from the text:
The Green Devil wants to know;
How to hook a base-16 hex encoding potentiometer to an input on a propeller processor to write special purpose registers?
If 100mΩ is the right resistance range to write special purpose register assignments?
Also, Assuming 0 is 0mΩ and 1 is 6.666666666666667mΩ, 2 being 13.33333333333333mΩn and 3 being 20mΩ. . . of an input voltage.
What is the input voltage to write? 1.5 volts? And where is the input voltage found on the 32-bit range?
Doing some math I have the vmax and vmin in big endian and know the hex range for each bit. But I’m a little unclear on the ohm scale given 5mA per 8pins or 40mA per pin of 8 excluding pin 0-6.
This is the math I've been gathering from the text:
Comments
The Propeller actually does all and everything in binary based maths.
Thinking in decimals, and especially floating point decimal is a human interface, a culturally accepted and popularized number base.
I am not sure when you mention base-16 if you mean what is generally referred to here as Hexadecimal. The Propeller Tool will compile SPIN code in Hexadecimal if that is what you wish to use. So with GCC in the Simple IDE compiler.
Special registers? Nothing like Special ADC registers. The Propeller 1 doesn't have built-in ADC. You would have to use a Sigma-Delta ADC or a chip such as the MCP3208 that is sold in the Parallax Store. If you have a Propeller QuickStart Board, there is the circuitry for one Sigma-Delta ADC, but you have to add some surface mount resistors and capacitors... very inexpensive components.
General registers? Well you have 32K bytes of HubRam and you can use any 4 contiguous bytes to get a 32bit integer representation. You can have signed or unsigned integers depending on what is required. Each Cog has 32bit registers --- 16 special purpose ones and the 496 general purpose ones.
Are these potentiometers digital? Is that where the Base-16 comes from? Do you have a data sheet that we might look at? Or a link to the product? Is their output in some serial format or are there actually 16 parallel output pins on the device (I have doubts about that)?
Regarding the input voltage. I'd have to see some technical specs on the device. The Propeller is limited to 3.3volts for i/o input and output. There are ways of interfacing devices that are powered with 5.0volts but inserting resisters between the Propeller and the 5volt logic pins.
Propeller pins will individually toleratate of to 40ma Absolute Maximum.
But the general rule is to stay far below an Absolute maximum... limiting your project to 25ma per i/o pin would be much more prudent. If you can get by with merely 5ma loading or less loading each Propeller i/o pin, you will generate a lot less heat and likely make things last much longer.
With a quick web search I was able to obtain the information you're looking for:
click here for documentation.
I double checked by looking at your attached documentation.
You have for output pins that go on and off in combinations to create a 4 bit hexadecimal binary. You have two pins that are connected together and are the common. You SEEM TO have 100,000 ohms in series to probably each of the 4 data pins to properly protect the Propeller. (But I had thought mine tested at Zero Resistance). Provide 3.3v to the common.
I would test to verify that each pin has 100,000 ohm resistance. It it is zero, this could do some real damage to the Propeller i/o. You would have to insert 10K ohm or higher to each data pin to safely connect to the Propeller.
Absolute Maximums 25am and 24VDC.
3.3VDC/ 100,000 ohms = 0.033ma So these are way below the Absolute Maximums.
3.3VDC/ 10,000 ohms = 0.33ma IF you need to add resistors, the Propeller would be safe.
It seems like you were expecting to do something different. I seem to have never properly understood the device before. So let me get back to you once I have run some bench tests with my own. If they do have internal resistors at 100,000 ohms, they are much easier to use than I previously considered. I thought they have zero resistance in the ON position
(Page 14: Understanding Signals with a propscope: Function Generator) The text states that the voltage range for the propeller is actually -1.5vdc to +4.7vdc even though it's been stated as 0vdc to 3.3vdc.
Test are for Absolute Ratings. Not really, recommended Operating Range. The figures are there to indicate the degree of ruggedness and tolerance to abuse.
I am VERY concerned that you may have misread the specs of your switch and that it offers NO resistance. This is very important to confirm before you hook them up to anything that you want to avoid damage to. You could short-circuit something.
I understand how to use the compiler, but to better understand addressing I want to use encoding switches. By saying they aren't potentiometers do you mean that the resistive increments don’t increase evenly as you turn the knob to the right to the next number or letter?
The resistance will likely need to be added to the 4 output pins to make the High/Low patterns readable and that will take 4 Propeller pins.
++++++++++++++
I have set mine aside somewhere and can't easily find them. And you really need to verify your own so you to don't begin to wonder if yours are not the same as mine.
You should be able to convince yourself that there are no internal resistors or that there really are. I'd be very surprised if the ones you have do have internal resistors.
Thinking that the encoder switch would narrow down the set of 0-255 ASCII to 0-F hexadecimal. Now I'm thinking of just creating a resistor bank based on what my keyboard is outputting for each 0-F. Depending on what characters it actually takes to get to a special purpose register and bit field.
The document you linked to does say SWITCH at the top. Since it has I sky in the background, I didn't see it at first, had to go back about four times before I noticed.
What are these intended for?
Well a lot of EEPROMs have 3 pins for an address selection. They would work well with those and have one bit left over for whatever. But you could simply use a DIP switch or jumpers just as easily.
I thought that they might be useful to have the Propeller programed with 16 different configurations and then just use this switch to choose which one it would start in.
That 100mΩ is likely 100 milli-ohms as it is a switch. In other words 0.1 ohm when the contacts are ON.
You had me confused. It is certainly not Kilo ohms or Mega ohms. LOL.