TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (348 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 (136227 times)
  2. FAT32 Library (69495 times)
  3. Network Ethernet Library (55712 times)
  4. USB Device Library (45996 times)
  5. Network WiFi Library (41640 times)
  6. FT800 Library (40804 times)
  7. GSM click (28789 times)
  8. PID Library (26333 times)
  9. mikroSDK (26061 times)
  10. microSD click (25148 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: 3995 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

DC MOTOR click

0

This application change the speed and direction of DC Motor

[Learn More]

Step Up click

5

Step Up Click is a fixed frequency DC-DC step-up (boost) regulator, which can be obtained from any low voltage input - such as NiCd, NiMH or one cell Li-Po/Li-Ion batteries.

[Learn More]

PROFET 2 3A click

0

PROFET 2 Click is a compact add-on board that contains a smart high-side power switch. This board features the BTS70802EPAXUMA1, a dual-channel, high-side power switch with embedded protection and diagnosis feature from Infineon Technologies.

[Learn More]