-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Due TWI+TWI1 pins : are there integrated pullups on-board or not? if yes: how to disable? #4007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
why is there no one who can comment and fix this effing issue? |
Seems like you need some help to search info. I found this (in 10 us :-) here: https://www.arduino.cc/en/Main/ArduinoBoardDue
Cheers! |
thank you, but then I wonder why the Mega with disabled pullup resistors works as an i2c slave (to a Lego Mindstorms EV3 master) and the DUE don't - neither by Wire not by Wire1. http://www.mindstormsforum.de/viewtopic.php?f=25&t=8673#p67709 In this case it must be a hardware bug which needs to be fixed pls CMIIW). |
Can you get the Due to work as an I2C slave at all? For instance with a Mega as master. It does not necessary have to be a hardware issue. Have you tried debugging the Due I2C code? Checking the state machine etc. Thanks for the poetry :) |
BW: Is there a difference in voltage? The pullup resistors on the Lego Mindstorm might be to large and/or expects 5V? What is the spec? The Due is a 3V3 board. Is it not? http://forums.adafruit.com/viewtopic.php?f=31&p=191092 (Goggle 42 us) |
According to Lego company specs, the EV3 is at 3.3V level but has a 5V protection. All new EV3 sensors also work at 3.3V level (ADC, UART, I2C). 2 DUEs work by i2c by a simple test, 1 as a master, 1 as a slave (Wire-Wire, Wire-Wire1, Wire1-Wire). By having internal pullups activated also the Mega fails to work with either Lego brick. The dexter industries example works with an Uno, basically it's similar to my approach using a Mega. |
Good work! You will need a scope or at least a logic analyzer for the next step. So far this looks like a hardware problem in your setup. There is no evidence that there is a problem with the Due board or the software then. Have you tried a level shifter with the correct pullups on both side? Cheers! |
no, I dont have level shifters and I also don't have a scope, I am not experienced in electrical stuff. Just plugging wires from one header to the other is ok of course. |
@vogonjeltz |
I'm not quite sure if everything is answered. |
This is not a support forum. It really looks like a hardware issue, so arduino IDE developers cannot really help you. You might want to ask in the forums or chat about this specific project question. A Level shifter (logic level converter) is 1$ and a logic analyzer (salae china clone) is 8$. Both can be really useful at any time/project. |
the design of twi.c in the avr subfolder is there by default, but it can only enable (or disable by outcommenting) AVR pullups, no ARM pullups.
So there has to be changed something in the ARM libs, and this is a question or a request to the developers, not to end users in either user forum. |
As said above from @mikaelpatel we do not have your hardware and cannot help you debugging your hardware. Grab a logic level converter and a logic analyzer and provide us more information. And if you need to change the "arm" lib, go ahead, its open source. The due is SAM by the way, no ARM. The forums are still a better place, since mostly noone checks the github issues, except some interrested developers. You have a better change to ask there or in the IRC chat. From time to time there are very experienced users. Another idea would be to ask @sandeepmistry who created a lot of PRs with TWI fixes. He is the guy to ask I guess. Good luck. |
which part was ununderstandable? So how to do it? If not implemented FTM: please implement it for the future release. This is my issue. |
@vogonjeltz Actually I could not find anything that looked like enabling of pullup - that assumption seems to be wrong for the SAM. In any case you could write a few lines of code and check the pin mode after initiating as TWI slave. I don't have an Arduino Due so I am sorry that I cannot help with that. I would also like to suggest that you check the ATMEL SAM documentation for the TWI. Guess there is some interesting info there. Keep up the poetry! |
SDA/SCL0-3 are connected to a pullup by hardware. (pin 7/8). Just use a multimeter or @mikaelpatel s suggestion. |
yes, also on the Mega SDA/SCL are connected to hardware pullup resistors, but they can be enabled or diasbled by software command in twi.c. The feature request to the developers was: |
Well it has in chip pullups and on PCB. Maybe the volt level is a problem or the Pullup is too strong/too weak. The devs have recognized your issue and will respond if they feel to respond. |
Now I think there is some confusion about hardware pullup resistors (internal or external). On the Mega (https://www.arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf) there are 10K external hardware pullup resistors. The AVR device driver code uses the internal port pullup resistors to protect the pins in TWI mode. These are large 20-50K but apparently affect the Lego Mindstorm when in parallel with the external pullups (6-8K when in parallel). The Due (https://www.arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf) on the other hand has external pullup resistors on Wire0 1K5 to VCC (3.3V). There are no external pullup resistors on Wire1. @vogonjeltz I think you have got this mixed up. Please check the schematics and the device driver code. |
Of course there are! RNB1 and RNC1, 10k pullup to 5V top middle next to the isp header (and the 16u2 has no I2C at all) Maybe you DO need pullups, but stronger pullups. |
@NicoHood Cheers! |
to be honest, I now don't understand any more what you're saying... too many "there is not" ...."there is though"...."no there is not, but something different"..."no, there is also not" ...."no, of course there is!"... "no, they are not, but does not help..." so can you confirm that there are DUE-pullups both on Wire and Wire1 (either if internal or external would not matter)? That would explain the issue, because pullups on the bus have to be at least 32k... up to 82k. remark: anyway, again, this following would be the crucial question: |
next,
if not possible FTM:
|
What does this have to do with the Arduino IDE? You need to consult the schematic and data sheets (noted previously IIRC). Try something out. You are not as simple as you claim. If you find something |
which part of this thread didn't you understand? in the Arduino-IDE/API (system installation folder) there is a file called twi.c for avr as I already repeatedly had posted, and with a twi.c patch it worked, search the post above! Now the request is about a similar API functionalty for the Due, is that so hard to understand? |
But we cant help you debugging your hardware problem without any hardware. You need to give us some information, as requested here: |
Not a problem, can you work on it? We're all volunteers here: help yourself. |
peabo, (honestly, I think Arduino would be better off if there were professional, full-time paid employees to care about all board issues and improvements.) |
Pins "SDA" and "SCL" (number 20 and 21) have pull-up resistor on board. This is explained here: https://www.arduino.cc/en/Main/ArduinoBoardDue
They can not be disabled via firmware because there are two physical resistors on board (you should de-solder the components from the board to physically remove the pull-ups). The CPU on the Due board has pin pull-ups that can be controlled via firmware, but they are too weak (100KOhm) to be used in I2C bus. |
cmaglie, |
The internal pullups on the Mega (and most other AVR-chips) are smaller, typically just over 20k, which is usually small enough for I2C comunication. For the Due, the current resistors are soldered in place, so no, there is nothing you can do in software to disable them. A future revision could have a transistor added to enable/disable the pullups, but it seems unlikely that that extra complexity will be added. I'm not sure why you actually want to disable these pullups, though? They are required for I2c operation, so unless you're running I2c with another device that runs at < 3.3V, I can't see any reason not to have these pullups? |
they have to be disabled to be interfaced as a slave to a "very special master device" (see posts above). Now my question was, |
@vogonjeltz You are wasting the very valuable and limited time of many software developers with your selfish requests. Please stop using Arduino's Github issue tracker for your personal project tech support. DO NOT ask for improvements here regarding issues you do not understand. Ask on the forum first. You should never make these sorts of requests, without knowledge and experience, until other experienced people have confirmed the true nature of the problem. The forum is meant for exactly that type of conversation. For example, you should conduct this query on the forum. Solicit experts to answer your questions regarding what is and is not possible by the hardware. DO NOT POST HERE until after you have received confirmation from experts on the forum for your technical questions. You are selfishly wasting precious time from people who do contribute to Arduino. Please stop being so selfish and unproductive. |
Paul, |
my question was, If it's possibly in principal, please add this to the Arduino IDE. |
I answered your questions a few comments ago, so I'm closing this issue. I'm with Paul on this one - please stop expecting other people to do your homework for you. This is not the place to ask questions, only to report bugs or suggest specific improvements. |
no, you wrote something which was not the answer to my question and what I already knew and you asked things which already had been widly explained in posts above yours. my question was, If it's possibly in principal, please add this to the Arduino IDE. This issue is NOT resolved !! |
If you did not understand my answers, or think I misunderstood your questions, it is up to you to explain why you think this is so. Simply repeating your questions isn't going to help, since AFAICS I answered those questions exactly (though I'll likely stop investing time in you entirely...). |
no, you didn't, please read closely what has been written! Reopen this issue immediately !! |
I love those type of people <3 |
now what? |
@vogonjeltz I will give you a final reference to all you need to know to get it working; http://stefanshacks.blogspot.se/2015/03/how-to-connect-lego-mindstorms-nxt_84.html Please understand that you cannot disable hardware resistors on the board in software. You will need to remove them from the board. You did not disable the hardware resistors on the Mega. You disabled the internal pullup resistors. Have a nice day! |
mikael, I finally abandoned all my tries to interface an EV3 to a DUE, it really makes no sense. (The EV3 is really a complete misconstruction for having to be interfaced to standard devices.) But I need to de-activate all pullups on all DUE i2c ports nevertheless, for different issues, even on SDA and SCL (the 1st i2c port). I actually don't want to specify the reasons more detailed, I simply want to deactivate them by software. That's why I've asked about completely deactiviating pullups even on the first I2c. After Wire SDA+SCL pullups appear to be hardware pullups on board, just like for the Mega, I would assume that it must be possible to deactivate in a similar software manner on the Due, just like it's possible for the Mega. As it seems, this is not possible already right in the moment, I really don't know how to make it more clear in English, regrettably. |
So wie ich es verstanden habe, gibt es keine option bei dem DUE. Der chip kann das einfach nicht, also können Sie es auch nicht implementieren. Also wird es auch in zukunft nicht möglich sein die Pullups zu deaktivieren, da sie Hardwareseitig verhanden sind. Die kannst sie allerhöchstens von der Platine entfernen. So ist die limitierung. Wenn dein english wirklich pur aus google translator kommt, muss ich sagen: nicht schlecht. Durchaus sehr gut und verständlich. |
ich dachte, es ginge grundsätzlich, da peabo7 ja so großspurig behauptet hatte, ich müsse mich quasi nur hinsetzen und es selber versuchen, dann ginge es auch, und ich müsse niemand anderes damit behelligen. War dann aber wohl doch nur hohles Geschwätz. es sind schließlich exakt genau die gleichen, aufgelöteten Pullups bei Mega wie bei Due. Sollte es aber dennoch, unzweifelhaft und unumstößlich nicht funktionieren mit dem Due, dann kann dieser Fall tatsächlich geschlossen bleiben. (Das Englisch kommt aus Google translate, aber ich bearbeite es immer zwangsweise nach, sonst kommt nur Quatsch raus. Oder ich frage meine Tochter, die lebte eine Zeitlang in Louisiana. ;) ) |
Sieht so aus als kannst du keine Disablen, weil sie nie aktiviert werden. Sie haben doch geschrieben, dass sie zu schwach sind und deswegen hardwareseitige nochmal verwendet wurden. Ansonsten sind die links zum evo da oben doch sicherlich nützlich. Und für weitere Hilfe frag besser im Forum, da bekommst du wirklich hilfreicheren support, von Leuten die das eventuell auch schonmal gemacht haben. @mikaelpatel hat dir doch geschrieben, dass du Ihn einfach auch im forum hättest fragen können ohne hier groß tausend mal auf der gleichen Frage rumzureiten, die geklärt war. Also nimm den mega oder frag ihn im forum am besten ;) |
neinnein, das scheint anders rum zu sein - zumindest auf dem Mega: Der Mega kommt als Board nicht in Frage, es ist bei weitem zu leistungsschwach: viel zu langsam, und viel zu wenig RAM. Nachdem der EV3 aber inzwischen Geschichte ist, ist auch das Forum kein Thema. Hier geht es um eine Erweiterung der DUE-IDE/API, da hilft auch kein Forum mit noch mehr Laien, Besserwissern und Klugscheißern, das ist reine Github-Entwickler-Angelegenheit für Leute, die wirklich wissen wovon sie reden. Oder zumindest wissen sollten, wenn ich mir hier einige Posts so anschaue. |
Die beim Mega kannst du die auch nicht deaktivieren, nicht die auf der Platine. Nur die internen. Siehst du am Schaltplan. Ich hab nur ehrlich keine Ahnung davon, also halte ich mich da zurück weitere Aussagen zu treffen. |
ach sooo...dann bleiben also auch beim Mega die Board-Pullups nach wie vor aktiv .... Dann ist aber auch der DUE gestorben, denn ich kann ihn nicht mit 2 NXTs als slave verwenden, auch hier müssten dann die Board-Pullups komplett auf beiden i2c-Leitungen weg (das war der Sinn dahinter). Dann muss ich auf den TRE warten, oder es mit einem Raspberry Pi plus 1x Arduino Due versuchen. |
At last! |
Du kannst auch einen kleinen pro mini verwenden, den du über einen <Microcontroller/PC/Raspberry etc> deiner Wahl ansteuerst. Z.B. über den seriellen port, spi oder ebenso als I2C slave, wobei letzteres vllt nicht so sinnvoll ist. |
ok, danke, aber das ist jetzt kein Due-Problem mehr. |
hello,
1st question:
about Due TWI1 pins (2nd i2c port): are there integrated pullups on-board or not?
if yes: how to disable?
The text was updated successfully, but these errors were encountered: