Jump to content

MIOS8: How fast is the IIC (w/wo clock streching) & SPI clock


Rio

Recommended Posts

Simple questions for the core v3 /PIC18F board using MIOS8:

1. How fast is the SC line for both modes (MIOS_IIC_CtrlSet [0 default / 1 clock stretching]) ? and is it <400KHz? Because one of my external boards as an IIC slave only accepts a clock up to 400KHz and it does not react as it should ATM.

It seems that I get an ACK back to the PIC18F master in clock stretching mode, but the external device itself remains without any functionality. If I try it without clock stretching, the watchdog restarts the PIC18F master app because it does not receive an ACK in the loop and the loop probably runs too long for that.

BTW: the external board can be well controlled by an Arduino using the standard frequency of 100Khz defined in the wire/twi classes of the Arduino core library:https://github.com/arduino/ArduinoCore-avr/blob/master/libraries/Wire/src/utility/twi.h#L30

But of course I don't want to control it with an Arduino, but with my PIC18F with MIOS8!

 

2. I would also be interested to know how fast the SPI clock is - because for a special application it has to be <1Mhz.

Edited by Rio
some more details
Link to comment
Share on other sites

  • Rio changed the title to MIOS8: How fast is the IIC clock (with/without clock streching)?
  • 1 month later...

Short feedback to 1):

Regardless of the IIC clock rate (must be below 400khz), my solution now works with clock stretching. 

 

if anyone knows more about the SPI clock, please let me know.

Edited by Rio
Link to comment
Share on other sites

  • Rio changed the title to MIOS8: How fast is the IIC (w/wo clock streching) & SPI clock

Yes, clock stretching slows down the clock line for I2C communication. Some of the boards I use with I2C do not work because the clock rate is too high. With clock stretching it works but I don't know how high the clock rate is. But it must be below 400 kHz (this is the limit that is noted in the specifications of one of my external hardware). 

For SPI communication, one of my boards is limited to 1Mhz. So it would be good to know some specifications about the core8 board. 

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...