I2C With Attiny402

Go To Last Post
59 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My slave is an DRV10983 BLDC controller IC. I have previously implemented I2C using a DSPIC to drive this IC and it worked properly using address of slave (0xA4) and data bytes.

I have developed and implemented on hardware the complete solution to drive a 40WAtt BLDC motor (DSPIC + DRV combination). My motor is working perfectly fine.

 

Now, I just need to reduce the size from DSPIC to attiny as only I2C is needed to send command to DRV.

 

I have PICKIT4 and oscilloscope 

 

Since only single function(I2C) is needed from the microcontroller I chose ATTINY402.

 

Thanks 

Jeet

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My basic question was for clock but as you reply suggested to use atmel start, that issue got resolved but as the thread is in respect to I2C and the problems in regards to I2C are still not resolved.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jeet_1997 wrote:

My slave is an DRV10983 BLDC controller IC. I have previously implemented I2C using a DSPIC to drive this IC and it worked properly using address of slave (0xA4) and data bytes.

I have developed and implemented on hardware the complete solution to drive a 40WAtt BLDC motor (DSPIC + DRV combination). My motor is working perfectly fine.

 

Now, I just need to reduce the size from DSPIC to attiny as only I2C is needed to send command to DRV.

 

I have PICKIT4 and oscilloscope 

 

Since only single function(I2C) is needed from the microcontroller I chose ATTINY402.

 

Thanks 

Jeet

This would have been sensible information to put in your first message.

Choosing a new chip with inadequate documentation is unfortunate.

 

The DRV10983 has no register 0x50  (as far as I can see)

 

I conclude that you are just seeking to waste people's time.    I will give up.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Jeet_1997 wrote:

My slave is an DRV10983 BLDC controller IC. I have previously implemented I2C using a DSPIC to drive this IC and it worked properly using address of slave (0xA4) and data bytes.

I have developed and implemented on hardware the complete solution to drive a 40WAtt BLDC motor (DSPIC + DRV combination). My motor is working perfectly fine.

 

Now, I just need to reduce the size from DSPIC to attiny as only I2C is needed to send command to DRV.

 

I have PICKIT4 and oscilloscope 

 

Since only single function(I2C) is needed from the microcontroller I chose ATTINY402.

 

Thanks 

Jeet

This would have been sensible information to put in your first message.

Choosing a new chip with inadequate documentation is unfortunate.

 

The DRV10983 has no register 0x50  (as far as I can see)

 

I conclude that you are just seeking to waste people's time.    I will give up.

 

David.

 

same here I'm also out.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

I2C (TWI) signals are not BUSY and IDLE.  Maybe some UART signals were called that way back in the 20th century.  

 

I2C signals are 'asserted'  (SDA or SCL pulled to low) or 'released' (SDA/SCL allowed to be pulled to up Vcc by the 3K external pull-up resistors that are somewhere in the I2C circuit, hopefully).   Multiple sources can 'assert' the SDA line and only the Master can 'assert' the SCL line.  The SDA line is not in 'released' state until all the devices that are connected to SDA have 'released' this line.

 

If you are simply trying to do something easy like write 12 bytes over the I2C channel from the CPU to the external device, my advice is to simply use an Arduino Nano or ProMini.  The Nano costs about $4 USD on eBay and the ProMini costs about $2.50 USD.  It isn't the chip cost that is important: it is ALL the support libraries that are available and all the working demos that are available for Arduino. So you can get your application functioning is 1/10th the time that it takes using a "naked" AVR chip.  So your ATtiny402 costs $0.41 cents.  You still need an new and expensive programmer for its new (non-standard) UPDI interface.  And you have to spend MANY MANY hours reading the datasheets and experimenting to get it working right.

 

  Suppose you spend four hours on this simple I2C project.  If your time is worth $12-$15 an hour USD then you have spent $50-$60 on this application.  An Arduino Nano using the Wire.h library would have it up and running in 15 minutes.   $3 for 15 minutes developer salary plus $3.50 for an Arduino Nano module board: $6.50 total cost vs.  $60+ for a system that might work after four hours of research, coding, and troubleshooting.  Plus you still have to buy the new device programmer.    Unless you are an AVR expert, using Arduino is a no-brainer for small, limited-run projects. And the best way to become an AVR expert is to study the source code for the libraries that thousands of people have supplied for the Arduino to do things like USART, SPI, I2C, PWM, etc...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:

Multiple sources can 'assert' the SDA line and only the Master can 'assert' the SCL line.

 

While the master is the one pulling SCL low, any device

connected to the I2C bus can hold SCL low even after it

has been released by the master.  This allows a slow

device to regulate the bus speed in case the master is

going too fast for it.

 

--Mike

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jeet_1997 wrote:

SDA and SCL are constant high

Same problem I had with Mega4808.
Reason: Wrong value in TWISPIROUTEA (Portmux).

Last Edited: Sat. Apr 6, 2019 - 10:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GermanFranz wrote:
Jeet_1997 wrote:

SDA and SCL are constant high

Same problem I had with Mega4808. Reason: Wrong value in TWISPIROUTEA (Portmux).

 

Herr Franz,

 

TWISPIROUTEA ?!!!.

 

Regards,

Moe

 

Pages