Hi guys i am very new to arduino programming but i want change the I2C adress of arduino board.Currently it is 127(0x3F) but i want to make 5 bit adress(0-30). Any idea
Thanks in advance....
.Currently it is 127(0x3F)
sp. "127 (0x7F)"
Do you have any context for this question?
thanks for the reply....
but i could not understand what you mean to say.... but if you run nick gammon scanner program as one arduino master another as slave it always returns 127(0x7F sorry for previous error!!!!) that is 7 bit address but i want to change it to in range of 0-30 but how change it.... Is their any register(for Atmega328 their is register...), if it their how to set it????
Thanks in advance
Niladri....
Is their any register
You need to look at the TWAR in the processor datasheet.
Yes i know TWAR register of ATmega328 but how to set it using arduino sketch???? I am very new to it so any sketch is their which i can use or get a idea????
Thanks in advnace
Niladri....
Are you using the Wire library? (which is why I asked for context in reply #1)
You set the address in the "begin" method.
(is there something wrong with your punctuation keys?)
Yes i am using Wire library
Sorry i could not make myself clear
I know arduino I2C address is 127 but that is basically the I2C adress of the controller but controller I2C address can be changed by setting TWAR register. So i want to know it their is a funtion or sketch in arduino 1.0 IDE that can give me the access to the TWAR register of Atmega328.
Thanks in advance.
Niladri
So i want to know it their is a funtion or sketch in arduino 1.0 IDE that can give me the access to the TWAR register of Atmega328.
See reply #5.
You have the source of the Wire library, why not look at it?
When in doubt, there's always the reference
ok i am going through wire library will get back to the topic after some time
thank you very much
Niladri.
Sorry bit late to post this but this possible (not 5 bit address scheme).
In Wire.begin() if you don't write anything it will take the default address(i,e 127, 0x7F) but if you give any other address which does not conflict with other device it takes that address(if you send like Wire.begin(0x05) and then run the nick gammon scanner sketch making another arduino as master that the one which has been programmed with 0x05 will give the address 0x05. I have the screen shot i will post it some other time. )
Thanks everybody for their valuable input
Regards
Niladri