PIC16F <-> DS2431 (1-wire) through GPIO

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

PIC16F <-> DS2431 (1-wire) through GPIO

Postby khmok » Fri Mar 29, 2013 2:22 pm

Hi,

I am using PIC16F873A to communicate with DS2431 (1-Wire). All the 1-wire function (1-wire read, write and etc.) are based on AN126 apps note.
However, I encountered a strange phenomenon. As you see from the attachments, I have saved 0xBC for Data_Bytes[0] and the rest saved with 0x00. However, the moment I step through OWWriteByte, Data_Bytes[7] changed to 0x80 unexpected and it happens everytime.

Note:
1.Data_Bytes variable is ONLY use in this function (to store 8-bytes of data) and ONLY use to transfer to DS2431 (8-bytes as required in scratchpad).
2. In short, it doesn’t exist in other place, not even inside OWWriteByte.

How can that possibly happen? (which is stepping OWWriteByte while other non-relation variable get the value change.)

Extra information:
1. To store data in DS2431, procedure are write scratchpad -> read scratchpad -> copy scratchpad (to desire memory loc).
2. I am using MPLAB IDE v8.46 and HI TECH PICC compiler v9.0
3. 1-Wire has pulled up to 5V with 4.7kohm resistor. PIC16f873A is supply with 5V Vdd.
Attachments
Data_Bytes_0.PNG
Data_Bytes_1.PNG
Data_Bytes[7] Changed to 0x80 unexpectedly
khmok
Newbie
 
Posts: 13
Joined: Fri Mar 08, 2013 6:08 pm

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests

cron