How use PIN D+ & D- to transmit byte

15 Apr 2011


I need use the pin D+ and the pin D- on my mbed.

So , i write : DMX dmx(pD+,pD-);

And the compiler return this bug :

"Identifier "pD" is undefined (E20)

And so, my question is : How use Pin D+ & Pin D-

I need use this pin to transmit bytes to a DMX512

15 Apr 2011

Hi Orange,

The D+ and D- pins are specifically for USB connections, so can only be used for a USB device or host connection. Assuiming you are just after a DigitalIn/Out connection, you can use any of p5-p30.

Hope that makes things clear,


15 Apr 2011

Yes but the volt of the DigitalOut is 3.3V and the USB devise need 5.0V..

15 Apr 2011

In fact my librairy for DMX is :

  1. include "mbed.h"
  2. include "DMX.h"

DMX :: DMX(PinName Tx) : _Tx(Tx){}

void DMX :: Init(){ _Tx= 0; wait_us(88); _Tx=1; MAB

wait_us(8); }

void DMX :: setInfos( int * infos){ for(int j = 0; j < 512 ; j++){ _Tx=0; Start bit wait_us(4); for(int i = 0 ; i < 8 ; i++){ DATA _Tx=1; Just for test I write already 1 wait_us(4); } _Tx = 1; Stop Bit wait_us(8); } }

And in my DMX .. nothing .. My main call DMX(p9) ==> DMX.init() ==> while(1) { DMX(info) }

15 Apr 2011

Isn't DMX just a serial protocol? If so you should be using a Serial object and the pins it can use. D+ and D- are for USB and not serial.

15 Apr 2011

I used a DMX with a USB to comunicate and I seach how command this DMX ...

I have see that :

15 Apr 2011

If I understand correctly, you want to use a USB DMX interface with the usb host on the mbed? I am not too sure on the specifics of the DMX but it uses EIA-485 singaling. The device transmits at 250K baud with one start bit, 8 data bits and two stop bits. It might be easier to get a rs-485 transceiver and use the Serial class instead of dealing with the USB host.

If you go this route, check out these Maxim ICs.

15 Apr 2011

DMX is a serial protocall, the same as RS232, you can only use the serial port pins,



Enjoy Ceri

15 Apr 2011

My DMX is compose to an USB Port. It's why i want us the USB.

15 Apr 2011

Then you have to determine how the usb device is set up. Is it a simple USB Vritual Com port (similar to the FTDI chips) or is there a specific driver that goes along with it. If there is a special USB driver, you might not be able to do it on the mbed with any ease..

16 Apr 2011

Arf.. Yes there are a driver ..