Jump to content

I2C again: Why not use the built-in features?


wackazong

Recommended Posts

Hi!

Maybe its a stupid question, but I did not find the answer here: Why does MIOS not use the built-in I2C support of the PIC 18F4685? Pins RC3 and RC4 are used for that, but at the moment they are used for J6 and J10. If I build a MidiBox 128, then theoretically I could use these pins for a full I2C implementation, with multiple master support, couldn't I?

But that, of course, means extending MIOS, and I am not sure whether I will be able to do that...

Best, ALEXander.

Link to comment
Share on other sites

But the MIOS based IIC access methods are working very stable since years, why should the internal peripheral work better? There are several reasons, why I'm not using it (also historic reasons...) - one reason is, that the I2C pins can change between PIC derivatives, and mostly allocated by other useful functions.

So, I don't see any reason,w hy using the înternal SPI!

Best Regards, Thorsten.

Link to comment
Share on other sites

But: Now I have the problem that I would like to drive two I2C Buses, for the simple reason that I want to be able to adress my LED-matrix' rows and columns with subadresses. Because I need a subadress for each row, column and color, there are a lot of adresses pretty fast. Is it possible to use two I2C buses from one core, or should I use two cores? What do you think?

Thanks, ALEXander.

Link to comment
Share on other sites

Well, thats the big advantage of the bit-banging method, because you can copy the MIOS_IIC* routines into your application, (rename the functions and variables to avoid label collisions), and assign different pins to SDA and SCL

See also the source code http://svnmios.midibox.org/trunk/mios/mios_iic.inc

You will notice, that the code is very small, biggest part of the file is the documentation ;)

The number of IIC busses is only limited by the number of free pins - the integrated peripheral doesn't provide such a flexibility (thats another reason why I ommited it...)

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...