| Online Development Notebook > Index > ODN > Raw Device Programming > 1D - Reset1WireCmd |
Command #1D - Reset1WireCmd
VERSION 1.30+ of the firmware
Description:
Send a 1-wire (MicroLAN) reset pulse on the selected port pin. This command also sets the port pin for subsequent 1-wire write and read commands. The port pin direction is controlled by the 1-wire commands.
Command Format:
| Byte Number | Description |
| 0 | 1Dh: Reset1WireCmd |
| 1 | Pin - The bit that will be affected. |
| 2 | <not used> |
| 3 | <not used> |
| 4 | <not used> |
| 5 | <not used> |
| 6 | <not used> |
| 7 | <not used> |
Command Format Details:
Byte 0 contains the command. Byte 1 is the port pin that is selected as a 1-wire bus is configured with an internal pull-up resistor of approximately 14k ohm. During idle bus times it is this resistor that pulls the line high. When the U4x1 transmits a low signal on the bus, it pulls the line low with an open collector device.
Bit⁄Line Selection
| Byte Value | Result | Byte Value | Result | |
| 00h | Use A.0 as 1-wire bus | 08h | Use B.0 as 1-wire bus | |
| 01h | Use A.1 as 1-wire bus | 09h | Use B.1 as 1-wire bus | |
| 02h | Use A.2 as 1-wire bus | 0Ah | Use B.2 as 1-wire bus | |
| 03h | Use A.3 as 1-wire bus | 0Bh | Use B.3 as 1-wire bus | |
| 04h | Use A.4 as 1-wire bus | 0Ch | Use B.4 as 1-wire bus | |
| 05h | Use A.5 as 1-wire bus | 0Dh | Use B.5 as 1-wire bus | |
| 06h | Use A.6 as 1-wire bus | 0Eh | Use B.6 as 1-wire bus | |
| 07h | Use A.7 as 1-wire bus | 0Fh | Use B.7 as 1-wire bus |
Multiple 1-wire busses can exist simultaneously on the U4x1. It is the Reset1Wire command that sets the port configuration for a specific line, plus sets the subsequent read⁄write commands to use that line.
After the function is called, the returned byte contains a value that indicates if any device returns a presence pulse. If a device was detected, the returned byte will be 00h. If no device was detected, the byte will be 01h.
The U4x1 devices support 1-wire communication with any 1-wire device. When you select an I⁄O port line of the U4x1 to use as the connection to a 1-wire device, you have changed that line from just being a digital I⁄O line to a 1-wire bus. The Reset1Wire command configures the line with a 14kohm pull up resistor, and issues a reset pulse on that line. The Reset1Wire command returns (via a pointer - see the command description) an indication of the reception of the device presense pulse.
If you select a particular line to use as the 1-wire bus, you do so with the Reset1Wire command. A Read1Wire command or a Write1Wire command will operate on the line that was last referenced by the Reset1Wire command.
What this means is that you can use all 16 lines on the U4x1 as 16 seperate 1-wire busses. Issuing the Reset1Wire command is the way to get attention of the 1-wire devices on that bus, prior to using the Read1Wire and Write1Wire commands to communicate with the 1-wire device. You can use Reset1Wire to select and communicate with one line of the U4x1, then use it again to communicate with a different line on the U4x1.
You can use all 16 lines on the U4x1 to communicate with 16 1-wire devices, one per line. But you can also have multiple 1-wire devices on each line, and address them individually by using their ROM serial numbers. The 1-wire device documentation contains the details that you need to communicate with 1-wire devices.
The internal 14kohm pull up resistor will suffice for a short bus distance, but you should consider supplementing with a 10kohm resistor external to the U4x1 device. The 10kohm resistor would be connected between the 1-wire data line and Vcc (+5V).
Response Format:
| Byte Number | Description |
| 0 | 1Dh: StepperCmd |
| 1 | Status |
| 2 | <not used> |
| 3 | <not used> |
| 4 | <not used> |
| 5 | <not used> |
| 6 | <not used> |
| 7 | <not used> |
Response Format Details:
Byte 0 contains the command.
Byte 1 contains the connection status.
Byte 2 through byte 7 are unused.
| Hardware: U401 USB Interface U421 USB Interface |
| Programming: USBm DLL Programming Download Files |
| Application Notes: U4x1 Application Notes Misc Applications and Information FAQ |