A small embedded server. Get one for $40, including worldwide shipping.


Postby AndyGoy » Mon Dec 24, 2012 9:24 am

I thought this may be of help as I have read through the forum that I2C cannot be used as the main pins are in use
I am using the I2C interface for 1 wire via a ds2482-100 and an I2C LCD display
I am using the Alternate pins RB5 and 6
The clue is you cannot set alternate pins via your program if you use the bootloader
As the bootloader is the first program loaded on the PIC it sets the configuration bits
In the bootloader code add to FPOR & ALTI2C_ON recompile and upload
or in your programmer load the bootloader hex code, enable ALTI2C bit in the programmer configuration and rewrite the bootloader

There also seems some different suggestions for the I2C Baud rate value
define I2C_BRG 0x188 gives a 98Khz clock viewed on my digital scope

Below is the I2C 1 wire test
please see look for my website homemon for detailed graphs

Find all 1 wire devices
i2c online ack OW
Reset = 1
Aresult 1
Found device 1 FA000800C1634510
Search next
Search Done
Found 1 ow device

Obviously rewriting the bootloader is done at your own risk. you will have to upload your program after
Posts: 1
Joined: Mon Dec 24, 2012 8:40 am

Re: I2C

Postby ian » Tue Dec 25, 2012 4:48 am

Thanks for sharing. Is it homemon.co.uk?
User avatar
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Return to Web platform