![]() I don't understand how to properly use this interruption. In my mind, the interruption is call only when TWIE is set to one and when the twi module says (when he sets TWINT to one I guess) that he finished the job. My problem is, once I reset TWIE to one on my interruption, the code looks like to freeze(in ISR(), case 0, TWCR =.). Void sendData(uint8_t addr, uint8_t data) disable twi module, acks, and twi interrupt on charge l'adresse dans TWDR et on clear le bit TWINT dans TWCR pour demarrer la transmission start has been send, let's check if it's ok #define MT_DATA_ACK 0x28 //master ACK has been received ![]() #define MT_SLA_ACK 0x18 //slave ACK has been received #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) #define ADDRSHIELD 0xC0//adresse sur 8 bits In the datasheet, page 262, 24.9.2, bit 0, I can read that I have to set the TWIE flag to one to be able to catch the interruption. I'm using an Arduino Mega with an Adafruit motor shield v2.3. I would like to reprogram Wire.h, or a part, to use interruptions, in order to not waste time to wait. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |