Electronics > Projects, Designs, and Technical Stuff
One crazy SAMD21G MCU – I2C/RESET issues (custom PCB design)
(1/7) > >>
3dgeo:
Howdy,

I have custom PCB design with SAMD21G and 2 separate I2C (feather M0 bootloader).

I wrote  code to scan both I2C lanes and uploaded to MCU  – second I2C port (that I created) scan finds chips just find, but no devices on 1st I2C port (there are 3 devices with different addresses on that port). I also used default I2C scanner code that scans only default I2C port – same result, no devices.
And here is the interesting part – If I connect another I2C device with its own pullups – ALL devices just appears in the scan until I disconnect it and they disappear again. You may say it's pullups, well, just keep reading....
I have another SAMD21G bare breakout board with only necessary components, if I jumpwire it to the same I2C lanes (with pullups only on custom PCB) and scan – it detects those devices just fine (with no additional I2C device and no extra pullups). Pullups on that line works fine, I used 10K resistors pull to 3,3V.

Also that SAMD21G on the PCB doen't react to RESET going low (internally pulled up), at least computer doesn't make USB connect/disconnect sound (other SAMD21G break out board do).

I'm thinking this is cos of one of two things:
1. some SAMD21G pins are pulled up/down by the PCB design that shouldn't be and messes with reset
2. I did an oopsie on PCB design – one chip (on 2nd I2C port that works) uses interrupt pin, and I missed that this chip sends 5V instead of 3,3, so that MCU got 5V. After realizing this I disconnected that pin and tested – that interrupt pin on MCU seems to work fine still.

Eventually I will solder jump wires and connect pin by pin to breakout board to find out what is the issue, but as you can imagine it's very tedious task, so I just posting my issues in hope to get some ideas before I do that. Sadly I just can't change MCU – I don't have hot air station.

I little update: I figure I'll try to add another I2C device (with no pullups on it this time, pullups only on PCB), and "bad" MCU on the chip sees it, but this time it detects only that chip, it doesn't detects other 3 chips on the PCB. I tried again another I2C device with its own pullups – all chips gets detected. WTH...  :o

Cheers

ataradov:
Without looking at the actual I2C signals with a scope it would be impossible to tell what is going on exactly.

Same for reset. Check that the line actually goes low. I'm not really sure what you can really do to make it not go low short of connecting the reset pin directly to the supply voltage.
3dgeo:
It's actually 2nd version of this PCB, on a first version this I2C works fine (no changes between V1 and V2 in this I2C). And reset pin is connected only to testing pad so I could manually reset MCU if needed. I'm using Adafruit bootloader, so to enter programming mode I have to double tap reset pin, and with minimum config breakout of SAMD21G this works just fine, but with custom PCB I have to disconnect and reconnect power, then double tap reset pin, only then it enters programming mode. I think easiest way would be to populate another PCB and test it after soldering every component until I found the problem.

I have logic analyzer, will poke around tomorrow.
ataradov:
Is it possible that some code changes reset to be a regular GPIO pin? May be by accident?
3dgeo:

--- Quote from: ataradov on October 03, 2019, 01:10:30 am ---Is it possible that some code changes reset to be a regular GPIO pin? May be by accident?

--- End quote ---

I didn't mess with the fuses myself, but now as you mentioned – Atmel Studio could change them while burning bootloader. Tho I burned same bootloader to both SAMD chips so both chips reset should be messed up. Maybe that bootloader looks at specific pins states while IC  powers on and sets something accordingly...
Anyway, thank you, that was a good hint – I'll burn Arduino Zero bootloader and check I2C and reset pin. 

Update on the progress tomorrow :-+
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod