PDA

View Full Version : I2C howto questions



comwarrior
- 25th May 2010, 14:20
i'm using a PIC18F97J60 to 'handle' 50 software PWM controlled IO lines...
I also want an LED display and small custom keypad.

I decided to use a PIC16F723 to handle the keypad and LED display due to lack of IO lines and link the two via I2C interface.

The PIC16 will only be sending 6 bytes of data back to the PIC18 on a 'regular basis' say 4 to 10 times per second... The PIC18 is not required to respond...
The 6 bytes represent 6 variables that can be changed from the keypad.

now i've been studdying the PBP manual and their don't seem to be any examples of interpic comms using I2C unless i missed something????

Can someone point me in the right direction?
Thanks

mackrackit
- 25th May 2010, 14:57
This thread has links that might help but I have not tried it myself.
http://www.picbasic.co.uk/forum/showthread.php?t=6184&highlight=I2C+master+slave

comwarrior
- 26th May 2010, 11:40
hmm, that is quite disapointing...
I odviously need to do some experiments and tests...
It looks like in order to use the hardware I2C it would have to be setup manually...

What i can see is that the comms protocol needs to be created. For inter PIC comms this shouldn't be a problem but if you have an I2C bus with multiple diferent devices on then this will be a nightmare!

I don't know quite why 'professionally' that no one would share the code as Mel put it, perhaps i'm missing something?
But i may decide to publish my test code...

If anyone could drop me some pointers or any info at all on this that would be excelent...

Melanie
- 26th May 2010, 15:50
I don't know quite why 'professionally' that no one would share the code as Mel put it, perhaps i'm missing something?

Think about it - it would be commercial suicide to post some of the more complex code and allow competitors to bring their products to market. For you this might be a hobby, for others it puts food on the table and pays the bills. To put it bluntly, I'd rather the fruits of my labour went into my bank account rather than yours. *smiles*

comwarrior
- 27th May 2010, 16:05
your fruits can go in my account any-time :rolleyes:

Isn't that what the GNU is for?
i use linux software constantly... it's a serious shame PBP isn't linux compatible....

mackrackit
- 27th May 2010, 16:39
i use linux software constantly... it's a serious shame PBP isn't linux compatible.... If you do not mind a little WINE then it works fine. MCS does not so I use GEDIT or EMACS.
Goto the site in my signature and look at section
1.3 BLINKY
and if you are using the PicKit2 there is a section for that also.

comwarrior
- 27th May 2010, 17:29
my kit is custom...

I'm actually going to be purchasing PBP 2.60 and a U2 programmer...
I'm just waiting for melabs to email me back on a technical question to do with ICSP on low voltage devices with the U2... but i emailed them last night and they haven't responded yet :(

tenaja
- 27th May 2010, 18:29
If you want an open source compiler designed for Linux, then use sdcc.

comwarrior
- 27th May 2010, 18:39
going a little off topic here but, i have seen the fox micro linux systems... and i DOO like them...
Would love to run a cross compiled LFS system on a PIC...