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 (137083 times)
  2. FAT32 Library (70224 times)
  3. Network Ethernet Library (56097 times)
  4. USB Device Library (46424 times)
  5. Network WiFi Library (42040 times)
  6. FT800 Library (41381 times)
  7. GSM click (29109 times)
  8. mikroSDK (26558 times)
  9. PID Library (26487 times)
  10. microSD click (25486 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: 4158 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

Keylock click

1

Keylock click carries a processed sealed key lock mechanism that can be set in three different positions. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the PWM, INT, and AN pin on the mikroBUSâ„¢ line.

[Learn More]

Cap Touch 6 click

0

Cap Touch 6 Click is a compact add-on board that easily integrates projected capacitive touch into users' applications. This board features the IQS227D, a single-channel capacitive controller with an internal voltage regular and reference capacitor from Azoteq. Besides the capacitive sensing area, this board also has output pins for proximity and touch events with their corresponding LED indicators. The IQS227D automatically tracks slow varying environmental changes via various filters.

[Learn More]

PROFET 10A click

0

PROFET Click is a compact add-on board that contains a smart high-side power switch. This board features the BTS7008-1EPA, a single-channel, high-side power switch with embedded protection and diagnosis feature from Infineon Technologies. This switch has a driving capability suitable for 10A loads featuring a ReverSave™, which causes the power transistor to switch on in case of reverse polarity.

[Learn More]