|
Post by martinp on Sept 16, 2014 17:02:57 GMT
Hi Paul, (or anyone who is willing to help)
I'm very "green" as to the workings of DCC (as you may have realised from previous posts!) I have attempted to build a motor decoder, which worked fine until I installed it in a loco which would draw too much current, so...... I abandoned that now and have programmed up a 12F629 as a function decoder in the same stripboard. My problem seems to be the operation of the decoder; I can see a voltage change from 0v to 5v at the outputs B and D (pins 3 and 4/5 respectively) when using keypad keys 9 and 2 on my Massoth Navigator, so the decoder is obviously working, but I cannot see a change on pin 2, output A whichever keypad key I try. Could you give this old "noobie" fart a clue as to what I may be doing wrong please?
(BTW, I have programmed several 12F629s and they all respond in the same way)
TIA Martin
|
|
Trond
Keen DIYer
Posts: 18
|
Post by Trond on Sept 17, 2014 8:54:32 GMT
Try reversing the direction of the locomotive.
Unless you have programmed the output mapping CVs to something other than the defaults both output A and output B respond to function 0.
If function 0 is turned on and the locomotive is going forwards output A will be high and B low. If function 0 is turned on and the locomotive is going in reverse output A will be low and B high.
|
|
|
Post by martinp on Sept 17, 2014 15:54:20 GMT
Try reversing the direction of the locomotive. Thanks for your reply. The decoder is not in a loco, just connected to track power for testing, but I assume you mean turn the throttle on the navigator to the reverse direction? Y'see, I don't understand what "function 0" is, and I really don't understand "CV mapping" so would not have changed anything there........... More testing and I can see output pins 2 and 3 change as you describe when I change throttle direction IF the key marked 9* on the keypad is operated first, so I'm guessing that "function 0" is the throttle, would that be correct? If that is so, I do not really require that, as I will be using this decoder to light lamps in buildings etc. Again I'm guessing, but would I change the operation using "CV mapping" and if I am correct, how would I set that up so that each of the 3 outputs on the 12F629 PIC responds directly to a key (say 1 -8) on the keypad? Sorry to be so dim TIA Martin
|
|
Trond
Keen DIYer
Posts: 18
|
Post by Trond on Sept 17, 2014 17:40:41 GMT
The decoder is not in a loco, just connected to track power for testing, The decoder doesn't know, and doesn't care. Yes. No. Most likely your 9* key turns on and off function 0. Does the 9* key maybe have a lamp symbol next to it also? If you take a look at the CV list a bit down on this page here: dccdiy.org.uk/function.htmlYou will see that CV 33 and onwards can be used to map function numbers to outputs. By default output A is mapped to F0 forwards, B to F0 reverse and D to F2. In the list in the notes column for CV 33 you can see that a value of 128 corresponds to output A, 64 to B and 16 to D. If you wanted F0 to turn on and off output A no matter the direction you would write 128 into CV34 aswell as in CV33. If you wanted F1 to turn on and off output B you would write 64 into CV 35. You can also combine them. For example if you want F5 to switch both output B and D at the same time you would write 80 (64+16) into CV 39. How you write CV values you must read in your command station manual. Until I read your post I had never even heard the name Massoth Navigator so I have no idea how you do it on your system. Be aware that F3 is usually a non-latching function, i.e. it only turns on the output as long as you hold the key pressed. This is a function of the throttle/command station, not the decoder.
|
|
|
Post by martinp on Sept 17, 2014 17:45:11 GMT
Yeah!! Cracked it..... Changed CVs33 & 34 to zero, then CVs 35,36 and 37 to 128, 64 and 16 respectively and I can now switch outputs A, B and D on and off using keys 1, 2 and 3 on the Navigator keypad. See, if only I had tried a little harder eh! Martin [edit]PS: just missed your post Trond - but thanks for the explanation, very helpful [/edit]
|
|