| Motor de Búsqueda de Datasheet de Componentes Electrónicos |
|
TRM-915-R250 Datasheet(PDF) 17 Page - Linx Technologies |
|
|
|||||||||||||||||||||||||||||
TRM-915-R250 Datasheet(HTML) 17 Page - Linx Technologies |
|
17 / 39 page ![]() – – – – 28 29 The UART Interface The module uses a standard UART interface for both data to be sent over the air and for configuring the module. The CMD line is used to tell the module if the data on the UART is for configuration or transmission. The lines follow the standard UART naming convention, so RXD is the data input into the module and TXD is the data output from the module. The UART interface expects 1 start bit, 8 data bits (LSB first), and 1 stop bit per byte with no parity (8-N-1). The module has a 256 byte buffer for incoming data. The module can be programmed to automatically transmit when the buffer reaches a limit or based on the time between bytes on the UART. This allows the designer to optimize the module for fixed length and variable length data. The module supports streaming data as well. To optimize the module for streaming data, regUARTMTU should be set to 128, and regTXTO should be set to a value greater than 1 UART byte time at the current UART data rate (10 bit times rounded up) or 2, whichever is greater. If the buffer gets nearly full (about 224 bytes), the module pulls the CTS line high, indicating that the host should not send any more data. Data sent by the host while the buffer is full is lost, so the the CTS line provides a warning and should be monitored. When there is data in the UART receive buffer, the BE line is low; when this buffer is empty, BE is high. Configuration Command Formatting The 250 Series module contains several volatile and non-volatile registers that control its configuration and operation. The volatile registers all have non-volatile mirror registers that are used to determine the default configuration when power is applied to the module. During normal operation, the volatile registers are used to control the module. Placing the module in the command mode allows these registers to be programmed. Byte values in excess of 127 (0x80 or greater) must be changed into a two-byte escape sequence of the format: 0xFE, [value - 128] For example, the value 0x83 becomes 0xFE, 0x03. The function in Figure 20 prepends a 0xFF header and size specifier to a command sequence and creates escape sequences as needed. It is assumed that *src is populated with either the register number to read (one byte, pass 1 into int EscapeString(char *src, char src_len, char *dest) { // The following function copies and encodes the first // src_len characters from *src into *dest. This // encoding is necessary for module command formats. // The resulting string is null terminated. The size // of this string is the function return value. // --------------------------------------------------- char src_idx, dest_idx; // Save space for the command header and size bytes // ------------------------------------------------ dest_idx = 2; // Loop through source string and copy/encode // ------------------------------------------ for (src_idx = 0; src_idx < src_len; src_idx++) { if (src[src_idx] > 127) { dest[dest_idx++] = 0xFE; }/*if*/ dest[dest_idx++] = (src[src_idx] & 0x7F); }/*for*/ // Add null terminator // ------------------- dest[dest_idx] = 0; // Add command header // ------------------ dest[0] = 0xFF; dest[1] = dest_idx – 2; // Return escape string size // ------------------------- return dest_idx; } Figure 20: Command Conversion Code src_len) or the register number and value to write (two bytes, pass 2 into src_len). It is also assumed that the *dest buffer has enough space for the two header characters plus the encoded command and the null terminator. |
|
Enlace URL |
| ¿ALLDATASHEET es útil para Ud.? [ DONATE ] |
Todo acerca de Alldatasheet | Publicidad | Contáctenos | Política de Privacidad | Enlace a la hoja de datos | Intercambio de Enlaces | Lista de Fabricantes All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |