Hi. I m using USI_TWI driver for tiny2313. I want to set clock rate for 100KHz as my slave operates only at 100KHz. I have connected 8MHz external oscillator for tiny2313. Please help me to set the constants in drivers to generate clock @ 100KHz.
Here's the code you need to make the 2313 divide it's clock by 8. This is described in the data sheet (page 30), so have a look there if you need more details. Using a 1MHz clock will result in the I2C bus running at 100KHz max.<br /><br />// Make clock go 4MHz <br /> CLKPR = 0x80; // Initiate write cycle for clock setting<br /> CLKPR = (1<<CLKPS1) | (1<<CLKPS0) ; // Divide Clock by 8<br /><br />Good Luck!<br /><br />
Get More Out of Instructables
Already have an Account?
PDF Downloads As a Pro member, you will gain access to download any Instructable in the PDF format.
You also have the ability to customize your PDF download.
Comment: The bolts are spaced such that they byte into the sides of the nozzle and hold it secur…
Comment: First, I *really* appreciate your spirit of collaboration. Your eagerness to contribute…
Comment: Good catch! I didn't have these in the parts list. Small rubber o-rings under a washer …
Comment: The driver shown is of my own design and uses the Allegro A4988 chip. The A4988 driver …
Comment: That's the point of this design. It gives a really good Oogoo mix with little effort. I…