¿ªÔÆÌåÓý

Locked Re: NCE USB Issue with RPi4 #rpi #nce #powercab


 

¿ªÔÆÌåÓý

Inobu,

On 31 Dec 2019, at 2:35 PM, Inobu One via Groups.Io <one2beros@...> wrote:

On boot up JMRI is looking to contact the Power Cab Command station but it will not be able to communicate with it until NCE USB interface is established. The NCE USB interface will not go active until it gets a Cab ID.
After the Power Cab gives the Cab ID to the USB interface its not looking to do anything else and that handshake transaction is complete. Mean while JMRI is reporting no communication with the Power Cab and just cycles through.

The NCE USB consists of two optically-isolated parts, linked by a pair of optocouplers (TX and RX only, no hardware handshaking).

1) The USB part is a SiLabs CP2102 USB-UART chip. Your computer provides 5V power to this chip, it responds on the USB data lines and your computer loads the SiLabs Driver. When JMRI opens a connection, it tells the driver what baud rate to set in the CP2102.

2) The rest of the NCE USB board is powered by 12V from the cab bus. It has a microprocessor with an onboard UART connected to the two optocouplers, input pins with jumpers and other I/O pins to talk to an RS485 transceiver and several LED drivers. When 12V power is applied, the microprocessor starts up, reads the jumpers (once-only) to set its UART board rate (and a system-type setting). It doesn't attempt any communication bus initially, just sits and waits for instructions from the USB part.

NCE USB Communications:

Once JMRI has opened the port, it sends an "AA" binary command to the device. If the baud rates match, the microprocessor replies with three binary bytes, the 07 30 07 (or whatever) we see in the log. At this stage there is still no attempt by the micro to talk to the NCE Cab Bus.

Once JMRI has received the response to the AA command it assumes it has full communication and the status goes green.

Once JMRI sends any other command (with a couple of exceptions) to the NCE USB, the micro will need to pass the command on to the Power Cab via the Cab Bus. But the NCE USB is a slave device and cannot initiate communications. It cannot speak until asked to by the Power Cab.

The Power Cab loops sending out "ping" commands to all possible address. When the NCE USB sees a ping command addressed to its CabID*, it responds with the command JMRI sent and waits for a response from the Power Cab.

When the micro is in the process of waiting for an ping so it can send a command to the Power Cab, it will turn the Cab Bus LED on. This is the step where things most often go wrong and a stuck-on of Cab Bus (or USB Bus) ?LED will require a power cycle of the microprocessor.

Once the micro gets a reply (e.g. CV contents) from the Power Cab, it will pass that back to JMRI via the optocoupler.


* What is the CabID of a given NCE USB?
- For some jumper settings (e.g. All Off), the CabID is always forced to 3.
- For some jumper settings (e.g. All ON), the CabID is stored in the NCE USB and programmable by the "B1 xx" command (another command handled locally by the micro and not passed on). (JMRI's Configure USB menu item).

Dave in Australia



Join [email protected] to automatically receive all group messages.