There. One Eureka. I'm going back to my JMRI and a bottle of Tylonol for my headache now.
-Morgan
Hamltnblue and Randy, I want to thank you guys for taking the time to explain how binary bits are equated. I will will work with your formulas this weekend. I never was good at math.
Also Kevinshope, DavidB mentioned you could use the PR3 from Digitrax with your computer to use JMRI decoder programer software. I would just like to add that the SPROG2 is also a very good option,and it comes with a power supply and USB cable also. And you can run trains with it. I have the MRC interface and it is very limited compared to what JMRI offers.
Truck
Being an ex-programmer (gave it up for Lent and never looked back) i can handle the programming. It is understanding what each function does that drives me up the wall!
Sean
HO Scale CSX Modeler
It's always good to undertsnad what's goign on, even if you then let a program like JMRI do it all for you on a regualr basis. How else are you to know what's happening when somethign goes wrong?
Extreme example, but if civilization were to collapse, how many people understnad the basics of makign useful tools without fancy computer controlled machine tools? Math without calculators? Or even farming, without tractors and combines and GPS guidance systems? It helps to understnad what JMRI is doing, even if you aren't sitting there calculating bits.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
rrinker And no, math class will not end. It will end when someone besides me finally gets this - I need to see just ONE Eureka! --Randy
And no, math class will not end. It will end when someone besides me finally gets this - I need to see just ONE Eureka!
Randy, I get it, probably because I work with both binary and hex at my day job.
But I don't want to have to work with it in my hobby as well, which is one of the reasons why I use JMRI!
Binary to hexadecimal though, it super easy, because every 4 bits is exactly 1 hex digit.. Take the example above, only make it 1 1 1 1 in binary. That's 1 + 2 + 4 + 8 = 15 = F in hexadecimal. A full 8 bits in exactly 2 hex digits. You just cut it in half and work with the first 4 bits and then the second 4 bits. SO while 10011101 looks liek HUH? What you do is make it into 2 equal halves
1001 and 1101
1001 that's 1 + 8 = 9
1101 is 1 + 4 +8 = 13 or D in hexadecimal
Put it back together, it's 9D hex. To decimal: 9 x 16 + 13 = 156
You cna go right from the seperate binary groups of 4 (called 'nibbles' - half a byte!) to decimal but it's not intuitive. In fact hex is so engrained in me that the only way I cna even explain it is to skip right to the last step: 9 x 16 plus the 13 from the second half. Groupings of binary digits cannot be directoly translated to decimal because there are no common factors. But nuber bases based on powers of 2, you can fit binary digits in to. After binary, there's octal, base 8, with each digit being 0-7. Checkign the binary again - yoiu can see that 3 binary digits allow the valus 0-7, so to convert to octal you'd start at the rigth and pick off groups of 3 bits. Early Intel processors used ocatal, and the machine language was written based on octal. Octal is a bit wierd because if you break up 8 bits into groups of 3, you get two groups of 3 plus 2 left over. The last two can have values from 0-3. So the biggest 8 bit octal number is 377. Not intuitive. FOrget that, everyoen else used hexadecimal. Hex breaks up nicely into even numbers of bits - 8 bits = 2 hex digits, 16 bits = 4 hex digits, etc. No odd leftovers, just nice even numbers.
Truck One day I'll figure out how all those 1's get caculated in to big numers in the Binary system, but for now these resources have helped me get my locos dialed in nice with the lighting and sound systems on them.
One day I'll figure out how all those 1's get caculated in to big numers in the Binary system, but for now these resources have helped me get my locos dialed in nice with the lighting and sound systems on them.
Adding Binary is exactly the same method as Decimal, only there are different values. For example
In Decimal the numbers go from right to left, each position has a value. There are also 10 possible values for each position. Each time you jump a position you multiply by 10. For going to a thousand the positional values for 4 positions are.
1000's 100's 10's 1's
If you have a number 2345, you add the positions. 5 ones, plus 4 tens, plus 3 hundreds, plus 2 Thousands. Added up you get 2345.
For binary you use the same method, however the difference is that each position only has 2 possible values 0 and 1. Since there are only 2 values each time you jump a position you multiply the previous positoin by 2 to find the decimal equivelant.
Here's 4 positions once again.
8 4 2 1
To calculate a number you do the same thing If there is a 1 you add the positional value, if there is a zero you don't add it.
If you have a binary number of 1011 you calculate the decimal value as follows.
Positon 1 is a 1, Position 2 is a 1, Position 3 is a zero, Position 4 is a 1. So you add 1 plus 2 plus 8. for the 3 positions that have a 1. The answer is 11.
For bigger numbers you just keep multiplying positions by 2.
1100101 is 1 plus 0 plus 4 plus 0 plus 0 plus 32 plus 64 and equals 101 in decimal.
When you go to hex it's the same theory but the amount of characters is 16. 0 thru 9 and a thru F.
Converting this to decimal is a little harder so the manufacturers tend to stick with binary and decimal.
Springfield PA
The lesson is, the basics are easy - on ALL systems. It's the more complicated stuff where it gets to be fun. An unfortunately (fromt eh standpoitn of many), it just makes a million times more sens to bitmap a CV than to make 8 individual CVs. It's just the nature of how a digital circuit works. It's not some conspiracy by the manufacturers to make this difficult.
And it remains a fact that if properly planned, the easiest way to handle bitmapping is via hex numbers. Like Digitrax lighting functions. 4 bit are the effect, adn 4 are the qulaifier (forwrd, reverse, independent, etc). You simply cannot divide groups of bits evenly into decimal numbers. That fact that is IS neatly divided into groups of 4 bits each show good plannign and design. If it was all willy-nilly, it would REALLY be a pain to program. What they ought to do is have a small chart like TCS to check off the effect and the qulaifier you want, and then add up the numbers at the bottom for the CV value. The existing table actually does that, but people see the hex and their eyes glaze over.
Kevin, sorry but I find this all a bit amusing. MRC is so keen to rattle on about how incredibly user friendly their systems are, and in then end it turns out that they deal with the same decoder programming issues as in a similar way to all the other systems.
Simon Modelling CB&Q and Wabash See my slowly evolving layout on my picturetrail site http://www.picturetrail.com/simontrains and our videos at http://www.youtube.com/user/MrCrispybake?feature=mhum
It's really an extremely logical (pun only half-intentional) way of doing things If you wasted a memory location (which is what CVs are) for a simple yes/no, on/off option, you'd need 8 CVs where one will work. And it would be just as convoluted. To use 8 CVs, you'd have to say the exact same thing, only on a CV level - for lighting effect 'A', set CV50 to 0, CV 51 to 1, CV52 to 0, CV53 to 0, CV54 to 1, CV55 to 0, CV56 to 0, and CV57 to 0
Time 6 for a 6 function decoder. Plus all the 'regular' CVs. Nuts.
Or just use JMRI. But it's not that difficult if you think about it. Around here they teach alternate number bases in about 6th grade, but it is like 2 days tops out of the year so it gets glossed right over. But it's just an extension of the decimal system. In decimal we have ones, tens, hundreds, thousands - how does a 4 digit number describe quantities int eh thousands? In binary it's 1's, 2's, 4's, 8's, etc. An 8 binary digit (see where 'bit' comes from?) number can only go up to decimal 255. It's all a matter of how many unique quantities can be expressed in a single digit. In decimal, each digit can be any of 10 values, 0-9. In binary, only 2., 0 and 1.
Next week's lesson, hexadecimal.
I spent a lot of time last week educating myself on Binary calculations {BITS}. I still have not figured out how they come up with such big numbers using a bunch of 1's. So I let them do the calculating for me.
Here is a link to Tony's Trains web site that has a conversion chart, it is in PDF so you will have to click to download. I would suggest printing a copy, it helps.
http://www.tonystrains.com/technews/dcc_bihexdec_chart.htm
Also note that the BITS are numbered backwords, there are 8 BITS reading 7 to 0 from left to right. By using the chart you can figure out what BITS you want to change in a certain CV and then see what value you enter in to it.
With the MRC system you have, you would use the decimal value. I got lazy looking at Tony's chart and found this online Binary calculator , just select Binary input and decimal out put and click caculate.
http://calculators.mathwarehouse.com/binary-hexadecimal-calculator.php#hexadecimalBinaryCalculator
Good luck, Truck.
Okay...got it Randy. That is a really convolute way for them to have set it up, but I guess it could be worse. In the case of these Atlas decoders, CV 51 controls a variety of properties for the forward headlight, but the one I was interested in was inabling dimming of the headlight and then CV 52 should have let me dim or brighten that light. However, it doesn't seem to have worked. The front headlight stays the same brightness no matter what I do, so the decoder I have in that unit must have not have that function or I'm doing somthing wrong.
Thanks for your help.
Bits are binary digits. They cna be 0 or 1. 7 binary bits can represent any number from 0-255, which is the allowed value for most CVs.
If the manual is set up properly, the 7th bit should be on the left, and the 0 bit on the right:
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
Based on what you want to do (and this stuff generally does NOT controlt he light brightness, but controls if the light is a plain on and off light, directional, or if it's a flashing beacon, or a Mars light, or whatever other functions they may provide), you make the selected bit 1, and allt he other 0. SO say according to the table you need bit 4 set to 1 for a directional headlight, and bit 1 on to make it dim in reverse (arbitrary example, I am not looking at the instruction book, use the listed options, not mine. This is just an example)
So, you would have bit7 = 0, bit6 = 0, bit5=0, bit4=1, bit3=0, bit2=0, bit1=1, bit0=0
or: 00010010
In decimal numbers, the ons you would program into the CV, bit0=1, bit1=2, bit2=4, bit3=8, bit4=16, bit5=32, bit6=64, and bit7=128.
Write down the decimal number for each bit that has a 1 in it, and add them up.
bit1 =2 and bit4 = 16. 16+2 = 18 decimal, this is what you put in the CV to set those bits.
Write down some examples and try it - it's really pretty easy.
CV29 works this way as well, so that with one CV you can control the default direction of the loco, if it used 14 ot 28/128 speed steps, if it uses a short or long address, if it used a speed table or not, and other things. Just by turnign on and off the appropriate bits.
Quick update here. The bits are listed under the column intitled reg (register). I need to know how to program CV values that follow certain reg.
Thanks for the response. Do you know how to use CVs with the BIT adresses?
Atlas Headlights tend to be a little dimmer than other manufacturers so yours might be ok. A reset to default might be the best way to tell if they're too dim. Resetting will set to factory which would be correct.
Hello again, All,
So I've started buying units that have sound, and, as I'm sure you are aware, once you go sound, its hard to go back. So I had to buy a new power station that would let me program and adjust cv settings. I bought the MRC prodigy advanced, and I like it. However, my atlas locos have VERY low headlights on this system. I was looking through the CVs for the Atlas masters decoders and found some CVs that will manipulate the lighting, but they have a catagory called BIT. So...for example, next to CV 57, there are like 8 different functions, all with a different BIT adress, ranging from 0-7. Hopefully, some of you have encountered this and know what to do. How do I use the BIT adress to turn functions on and off. I was thinking that maybe you would use CV 57 and then say you wanted to turn on BIT 1, then the data number you enter would be 11 (the first one serving as the bit adress, and the second one serving as the on command). I wasn't sure, so I thought I would "ASK the EXPERTS!!!"