I2C1 issues

Posted on
  • Hi, I'm getting some errors on attempting to connect to the PN532 module w/ Pico

    cutting it down to the basics:

    I2C1.setup({scl:B6, sda:B7});
    I2C1.writeTo(0x50,[0,0]);
    

    And this happens:

    Uncaught InternalError: Timeout on I2C Write BUSY
     at line 1 col 24
    I2C1.writeTo(0x50,[0,0]);
    

    I'm not sure why this happens, maybe I connected it poorly?

  • Is that the right address? Datasheet says it's 0x48, and I'm not sure if that's 7 or 8 bit address (if it's 8bit, you need to rightshift it one bit - gordon does it in his module, so I suspect you need to as well - so 0x24.

    Do you have SDA and SCL right? I can't tell you how many times I've gotten them backwards.

    Does the breakout board you're using have the 10k pullup resistors on SDA and SCL? If not, you need to add them.

    Any of those problems could result in that error.

  • either way, the error accrues regardless adress, so it might be the either that i mixed the SDA and SCL up or the resistor, i'll get back to that when i get a chance. (does the pico have pullups? i can't tell.)

  • No, the Pico has no pullups on it - so if the board you connect to doesn't have them you'll have to include some.

    Also, do you have the up to date firmware (1v79) on your Pico? I know for a while there were some issues with I2C/SPI on certain pins, which have now been solved.

  • Alright, thanks for the info/help- I managed to get it work, I'm not sure on which made it work, but, I updated firmware (was on 1v77), took everything off the breadboard, put them back in and double and tripple checked everything and boom, we have liftoff!

    e; oh and i even replaced the resistors.
    e2; oh and, yes the address should have been '0x48 >> 1', but like i said, nothing was working, so, didn't really matter at the point.

  • WELL! I really screw up there- I dropped the nfc tag metal ring ontop of the reader, everything went black and the smell of burnet raised into my nose.

    the pico is now toastware in a fraction of a millisecond!

  • Check the diode closest to the usb connector - that usually is what goes even you short it. I have had to replace one already - you can use a through hole schottky diode if you don't care how it looks.

    On the second batch, Gordon found room for a self resetting ptc fuse, last I heard.

  • :( Argh... it is quite easy to do I'm afraid. I have no idea how some of the smaller Arduino boards cope (when making the Pico I'd looked at some of them, realised they didn't have fuses, and thought I could probably do without too).

    The batch that's just arrived is the same as the existing ones (I just wanted to get some more ones quickly!) but Seeed are getting ready to make a big batch of new ones, which will have a fuse.

    If you're only ever planning on running your board via the USB connector, you can actually just short out where the diode is - which is even easier to do! Also you can still use your board as-is by powering it from the Bat or 5V pins using a breadboard supply.

  • Hi, yes- i've already replaced the diode once already.. these things makes you feel really stupid

  • Which Arduino boards don't have polyfuses?

    The only one I see that doesn't is the pro mini - and all but the most faithful clones have added one! Uno, Due, Duemillipede, Micro, Leo, Mega official boards all have polyfuse.

  • I think it was a Pro Mini clone that I had... But as far as I remember (not at home so can't check at the moment) the Maple Mini, Olimexino, Matchbox ARM, Teensy 3, Stellaris Launchpad, all ST Discovery and Nucleo boards don't have fuses.

    edit: And I think also the mbed LPC1768...

    So I'm wrong to say 'other Arduino boards', but rifling through my drawer of boards (big and small) I didn't find very much that had a polyfuse on :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

I2C1 issues

Posted by Avatar for Deas @Deas

Actions