I think I got the answers to some of this on nxtasy, but obviously, I cannot go back to see.
I am thinking of trying to make the NXT into a DCC system (to run my digital HO trains).
I think it would essentially be like having the NXT use a serial protocol (I think just one wire) that does not have firmware support. Is that possible to do?
Is it possible to have direct access to the NXT's digital pins (5 and 6)? I would like to be able to read and write with them. I think that I actually only need access to either one. I know I can do this with pin 1, but I need a much higher update speed.
NXT as DCC controller
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
NXT as DCC controller
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: NXT as DCC controller
Hi,
I'm not sure if NXC gives you access to the data pins. But even if it does you also need to check the bit rate required by DCC (and accuracy required for the timing), even if NXC gives you access it may not be fast enough (or may have too much timing jitter)... Do you know what the timings are for DCC?
leJOS certainly gives you access to the pins, it is also probably faster than NXC for these sorts of operations. However it may not be fast enough (I think the fastest rate that it can toggle a pin at is about one cycle per 10uS or so), and you will be looking at jitter larger than that (much larger in the 1mS range if other threads are running)...
Andy
I'm not sure if NXC gives you access to the data pins. But even if it does you also need to check the bit rate required by DCC (and accuracy required for the timing), even if NXC gives you access it may not be fast enough (or may have too much timing jitter)... Do you know what the timings are for DCC?
leJOS certainly gives you access to the pins, it is also probably faster than NXC for these sorts of operations. However it may not be fast enough (I think the fastest rate that it can toggle a pin at is about one cycle per 10uS or so), and you will be looking at jitter larger than that (much larger in the 1mS range if other threads are running)...
Andy
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXT as DCC controller
For NMRA, the standard for a "1" bit is 58uS up (positive), and 58uS down (negative)(116 uS cycle time). For a "0" bit, the standard is 100uS for up or down, and the other is variable (100 + uS)(200 + uS cycle time). There is a little info here about the timing http://en.wikipedia.org/wiki/Digital_Command_Control. In case you want to see them, the protocol standards are here http://www.nmra.org/standards/DCC/stand ... 004-07.pdf.
What do you mean by the jitter being as high as 1mS?
What do you mean by the jitter being as high as 1mS?
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: NXT as DCC controller
For jitter I mean that for instance even though have requested a sleep for say 100uS or are using a timing loop, the firmware may go off and do something else (like run another thread), and this may mean that the sleep/loop may take longer than you expect. In the case of leJOS even a high priority thread may have to wait for 1mS or so every now and again (if the GC runs for instance). I'm not sure about NXC but I suspect it may have similar issues particularly if you are trying to run other threads or are using other sensors, Bluetooth etc...
Andy
Andy
Who is online
Users browsing this forum: No registered users and 4 guests