Home >


  • Atmega328P ports stop working after starting TWI transmissionMay 19

    I'm running following piece of code: #include <avr/io.h> int main(void) { TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN); DDRD = 0xFF; PORTF = 0xFF; for(;;) asm volatile(""); } After that, with multimeter, I check DC voltage leve

  • Unable to implement TWI with Atmega8January 12

    My goal is to interface an IC AT24C16 with Atmega8 through TWI. I tried every solution possible from online forums but I see no meaningful signal in the oscilloscope. This is my code. Can some one point out me what am I doing wrong? Regards G Haripra

  • Port I2C code from Arduino to SercomNovember 30

    I'm having a MPU-6050 (gyro / accelerometer), it's connected to Arduino over I2C (via Wiring.h) and everything works well. Now I'm trying to port this code to an Atmel SAMD20 (Cortex M0+), which is bundled with Sercom I2C libraries. I have a connecti

  • about getting the ACK right in TWI

    about getting the ACK right in TWIOctober 19

    okay, i'm an old EE that mostly just writes DSP code and dinks around in MATLAB. but once in a while i get to dabble in more concrete things. and, actually, this TWI-bit-banging code seems to work, it's just that i was examining it (and refactoring i

  • TWINT flag never goes up

    TWINT flag never goes upAugust 5

    I want to establish I2C connection between two atmega2560. First one is working as a master, and second as slave. Master works on a transmitter mode, and Slave works as receiver. On Master side: Master seems to work correctly, because all code comes

  • I2C on atmega168/328 using interrupts

    I2C on atmega168/328 using interruptsJune 25

    I have the following I2C configuration with an ATmega168 (1 MHz) as the master and an Arduino Uno (16 MHz) as the slave. The command for the LED connected to the slave comes from the master and vice versa. I can't get the I2C to work. The LEDs are at

  • Xmega128C3 TWI read error

    Xmega128C3 TWI read errorMay 15

    I'm interfaceing an Xmega128C3 with MMA8451Q acceleration sensor via i2c. I was able to initialize the accelerometer, I checked every transmission on oscilloscope, it was done properly. The problem occurs when the xmega tries to read (in Master mode)

  • I2C Slave on ATtiny841March 17

    I am using an ATtiny841 microcontroller as an I2C slave, but I have difficulty finding information on it. So for, all I have are application notes and reference code for TWI and USI module. It seems like ATtiny841 has a unique TWI slave interface, wh

  • Using internal pull-ups for TWI on AT32UC3B?March 16

    Does anyone know if it's possible to use the built-in pull-ups for TWI on the at32uc3b chips? I've been adding external pull-ups to my TWI circuits in the past because I couldn't find any concrete info about this. But if it's possible to just use the

  • ATXMega32D4 Two Wire InterfaceDecember 2

    Lately i have been using ATMega32A and ATMega324PA and learnt various coding techniques in AVR C programming. One such code i wrote is avr_twi.c for communicating with an I2C accelerometer Now i got migrated to ATXMega32D4, and I can cope up with the

  • AVR TWI/I2C Not Responding September 9

    I use Twi module of AVR Atmega168 to talk to DS1307. Twi works on the interrupt mode. It works fine for a few hours and then stops, hopefully losing Twi interrupts further. Is there any way to fix/resolve/work around this issue. Any practical tips wo

  • AVR Error Handling: I2C, SPI etcAugust 9

    How would one go about handling errors in AVR interfaces that do not specifically provide any acknowledgement scheme? For example, I have an I2C temperature sensor which I poll every 1 hour. So every hour my AVR sends a TWI start condition to the sen

  • TWI problem on mega2560

    TWI problem on mega2560July 6

    The TWI on mega2560 seem to be malfunctioning. the below code, believed to be correct as per data sheet, gives a proper start sequence, a proper address and a correct ACK. But when writing and sending data to TWDR and then setting all bits in the TWC

  • AVR TWI Status Codes Complete ListJune 25

    Can anyone provide a link for complete list of status codes for AVR TWI? I am working with DS1307 using TWI, during which at some point I receive a status code of 0x40. However there is no mention of this code in the ATmega8 datasheet. --------------

  • BSS138 levelshifter draws 35-40mA current when one side is grounded?

    BSS138 levelshifter draws 35-40mA current when one side is grounded?May 12

    I completely rewrote my question as I found the source of the issue is related to the level shifter only. This is the circuit for a 3.3V to 5V bidirectional levelshifter, used frequently. My problem: I have the same circuit, and I built it 3 times no

  • i2C : pull-up resistors "design pattern", Shielded cable and connector?October 13

    I'm designing an arduino based board which will uses I2C port a lot. I want to be able to connect several slave devices, and/or connect several mother boards together (at least 4 would be great). The I2C will run at 400kHz @ 3.3V. The flat cable betw

  • How much max distance of SPI & USB & I2C and TWI(without any IC May 24

    How much max distance of SPI & USB & I2C and TWI(without any IC(my mean is directly)), and how can i amplify these? --------------Solutions------------- USB is required to work up to 5 meters and will become unreliable beyond that. The other commu

  • Why Atmel TWI doesnt support I2C START BYTE on TWI?April 22

    I would like to know why Atmel TWI doesnt support I2C start byte. I am reading the AT32UC3C2512C datasheet on the TWI part, and I can see it doesnt support the START BYTE from I2C (it's on page 698), and I would like to know the why, and the implicat

  • Establishing a proper TWI/I2C communication between a pair of Atmega32

    Establishing a proper TWI/I2C communication between a pair of Atmega32February 13

    I am a mechanical engineer with the desire of learning electronics stuff. I am working on these days at learning the TWI(I2C) communication in Atmega32. With a lot of internet search I have managed to get a tutorial explaining how I can make a mutual

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.405 s.