Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] How to write Text (Hello World) on iButton DS1994, P18F452

Status
Not open for further replies.

rajib.das

Member level 3
Joined
Oct 23, 2013
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
415
Hi there
I am trying to use DS1994 interfacing with P18f452.
My intension is to store data on iButton memory and also need to read the clock on it to set RTC PCF8593 .
So far I am able to read the serial key and print them on LCD.

Please any Kind of help would be much appreciated..

For convenience I have attached data sheet, schematics and my C protocols for one wire.
iBUTTON.gif
View attachment DS1994.pdf
Code:
//-----------------Initiate_iButton at RB0--------------------------------------
void Initiate_iButton (void){
     iButton_READ_Direction = 1;   // designate PORTE2 pin as input
    INTCON2.RBPU = 0; // to pullup internal resister at portB
}
//------------------------------------------------------------------------------
Code:
//---------------------Start iButton Coms Here----------------------------------
void Test_iButton (void){
    
    char sernum;
    char sernum_hex[8];
    int l;
    int colona;

    //Unique Part Serial Number
    Ow_Reset(&PORTB, 0);                         // Onewire reset signal
    Ow_Write(&PORTB, 0, 0x33);                   // Issue command Read_ROM
    Delay_us(120);

    Lcd_Cmd(_LCD_CLEAR);             // Clear display
    Lcd_Cmd(_LCD_CURSOR_OFF);        // Cursor off
    Lcd_Out(1,1,"1:iButton Key:"); // Prepare and output static text on LCD
    delay_ms(500);
    colona = 17;
    for(l = 0; l <= 7; l++)
       {
          colona = colona - 2;
          sernum = Ow_Read(&PORTB, 0);
          bytetohex(sernum, sernum_hex);
          Lcd_Out(2, colona, sernum_hex);
        }
        delay_ms(1000);
//------------------------------------------------------------------------------
}
View attachment DS1994.pdf
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top