Ports
This page provides definitions of port functionality on the 3DM-CV7-INS. Included in these definitions are port ID's, the type of port, the name of the port, and mapped supported functionality.
Port ID | Type | Name | Description |
---|---|---|---|
0x01 | Special | Main | USB1 (0x21) if port is open (DTR set), otherwise serial 0x11 |
0x11 | UART | Uart1 | “Main” serial port |
0x12 | UART | Uart2 | Serial port via GPIO 1/2 |
0x13 | UART | Uart3 | Serial port via GPIO 3/4 |
0x21 | USB | Usb1 | “Main” usb port |
The upper nibble (highest 4 bits) represents the port type, while the lower nibble represents the instance. So UARTs are 0x1_, USB is 0x2_, etc. 0x0_ is reserved for special cases.
Ex: For the UART feature, BEHAVIOR is divided into upper and lower nibbles (4 bits) for the port number and pin function.
BEHAVIOR = ((PORT_NUMBER & 0x0F) << 4) | UART_FUNCTION
BEHAVIOR = 0x22
| | __ Function: TX=1, RX=2
|
|___ UART: 1=UART1, 2=UART2, ...
The upper nibble of the global port number is dropped because it’s always UART in this case there aren’t enough bits for the whole number.
The mapping of UART ports and pins for 3DM-CV7-INS is shown below:
Port ID | Type |
---|---|
GPIO 1 | UART 2 |
GPIO 2 | UART 2 |
GPIO 3 | UART 3 |
GPIO 4 | UART 2 |
NOTE: It is not possible to assign the wrong port for a given pin. E.g. setting BEHAVIOR 0x22 won’t work for GPIO 3 or 4, and BEHAVIOR 0x32 won’t work for GPIO 1 or 2. BEHAVIOR 0x12 won’t work on any UART Type pins as port 1 is reserved for the main serial port.