TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137124 times)
  2. FAT32 Library (70240 times)
  3. Network Ethernet Library (56131 times)
  4. USB Device Library (46447 times)
  5. Network WiFi Library (42096 times)
  6. FT800 Library (41410 times)
  7. GSM click (29125 times)
  8. mikroSDK (26567 times)
  9. PID Library (26510 times)
  10. microSD click (25495 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

UART 1-Wire click

Rating:

5

Author: MIKROE

Last Updated: 2019-01-24

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: 1-Wire

Downloaded: 4166 times

Not followed.

License: MIT license  

UART 1-Wire click is used to convert standard UART or 5V RS232 signals into 1-Wire signals.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "UART 1-Wire click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "UART 1-Wire click" changes.

Do you want to report abuse regarding "UART 1-Wire click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

UART 1-Wire click

UART 1-Wire click

Native view of the UART 1-Wire click board.

View full image
UART 1-Wire click

UART 1-Wire click

Front and back view of UART 1-Wire click board.

View full image

Library Description

The library initializes and defines the UART bus driver and drivers that offer a choice for writing data on UART. The library includes function for read n data and functions for go to Command/Data mode. The user also has the function for reset chip and storage read data.

Key functions:

  • void uart1wire_writeCommand(uint8_t input) - Functions for write one byte on UART.
  • uint8_t uart1wire_readByte() - Functions for read byte from UART.
  • void uart1wire_goToCommandMode() - Functions for go to command mode.
  • void uart1wire_goToDataMode() - Functions for go to data mode.
  • void uart1wire_readData(uint8_t *buf, uint8_t nData) - Functions for read data.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes UART module.
  • Application Initialization - Initializes Driver init, interrupt routine and init thermo 2 click.
  • Application Task - (code snippet) - Reads the temperature from the Thermo 2 click board and logs data to UART. Connection between Thermo 2 and UART 1 Wire is made through 1- Wire interface. You can place thermo 2 click on mikrobus 2 socket and use side headers to make connection between click boards.
void applicationTask()
{
    /* Start converzion */
    uart1wire_reset();
    uart1wire_goToDataMode();
    Delay_10ms();
    uart1wire_writeCommand(_UART1WIRE_SKIP_ROM);
    uart1wire_writeCommand( 0x44 );
    Delay_ms( 750 );
    
    /* Start reading temperature */
    uart1wire_reset();
    uart1wire_goToDataMode();
    Delay_10ms();
    uart1wire_writeCommand(_UART1WIRE_SKIP_ROM);
    uart1wire_writeCommand( 0xBE );
    Delay_10ms();
    
    uart1wire_readData(&dataBuffer[0], 8);
    
    Temp = dataBuffer[ 1 ];
    Temp = Temp << 8;
    Temp = Temp | dataBuffer[ 0 ];
    
    fTemp = Temp * 0.0625;
    mikrobus_logWrite(" Temperature : ", _LOG_TEXT);
    FloatToStr(fTemp, demoText);
    mikrobus_logWrite(demoText, _LOG_LINE);
    
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 clickor RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

PWR Meter 3 click

0

PWR Meter 3 Click is a compact add-on board that measures voltage and current through the connected load. This board features the ACS37800, an I2C-configurable power monitoring solution from Allegro MicroSystems, which simplifies the addition of power monitoring to many AC/DC powered systems. The ACS37800’s Hall-effect-based current sensing technology achieves reinforced isolation ratings (4800 VRMS) alongside a reliable ±90A bidirectional current sensing. It also has two LED indicators for the realization of visual detection of some anomalies in operation, such as under/overvoltage and fast overcurrent fault detection.

[Learn More]

6LoWPAN C click

0

6LoWPAN C click carries the CC2520 2.4GHz RF transceiver. The click is designed to run on a 3.3V power supply. It communicates with the target microcontroller over SPI interface.

[Learn More]

Brushless 2 click

0

Brushless 2 click carries the DRV10964 BLDC motor controller with an integrated output stage. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the following pins on the mikroBUSâ„¢ line: RST, CS, PWM, INT.

[Learn More]