Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading DS1990a ibutton with 16F Microcontroller

Status
Not open for further replies.
haha lol,

So far when I touch the ibutton to the reader, fluctuations between 5V and 0 V were observed. This is rather good news. However, my MAX232 circuit is having a couple of problems so I can't transmit via RS232 to the PC.

I've tried the read function on the compiler to read the contents of the PIC but to no avail.

Any ideas?

in the meantime I'll be working on the MAX232 circuit
 
A good way to test if your MAX232 circuit is working is to remove the pic from it's socket and connect the RX and TX pins (7 & 8) together. If you then run Hyperterminal and select flow control = none, you should see what you type echoed back.

As for storing the ID in the EEPROM, you should be able to read the EEPROM with your programmer. What programmer are you using?

Mike.
 
I see. Will try it. I'm using MPLAB IDE v7.60 which is readily available on the terminal I'm working on in uni.
 
I've tested my max232 circuit and its working fine. tried with the ibutton in place but nothing happens. I've tried just sending fixed hex values from the PIC but still nothing works.

example : putc(0x11)

I've defined #use RS232 in the header and all the relevant options such as baudrate, xmit and and rcv pin.

Will continue tmrw
 
Hey,

new update:
the max232 circuit works good. I can send values from the PIC to the PC with no problems now. however, I still can't get the PIC to read the ibutton.

the PIC always seems to loop in the wait state. No matter what I tried, I can't get it to respond to an ibutton touch.

I suspect that I did not define whether the pin i'm using to serve as an output or input that's being the cause to this.

however, since the bus is 1-wire, the pin is required to serve as both input and output. how do i do this?

btw i've also found out that byte and boolean are predefined variable types in the PIC header file so even though they don't turn blue when I type them there is nothing wrong.

And can you explain this area of code to me?

Code:
#ifndef TOUCH_PIN
#define TOUCH_PIN PIN_B0
#if defined(__PCH__)
#bit TOUCH_PIN_BIT = 0xF8A.0
#else
#bit TOUCH_PIN_BIT = 6.0
#endif
#endif

Thanks a bunch
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top