![]() |
Forum Index : Microcontroller and PC projects : I2C2 check ?
Author | Message | ||||
DigitalDreams Newbie ![]() Joined: 03/05/2025 Location: United KingdomPosts: 34 |
PicoMite 6.0003 non-wifi Pico2. I have an RTC working perfectly on i2c2 for a few months and decided to daisychain another device. Not working. 'I2C2 check' acting strange too. The RTC continues without issue though. Yet... I2C2 check &h68 Print MM.I2C The working I2C2 RTC returns 2 ??, should be 0 or 1 according to the manual. The new device (FRAM)... I2C2 check &ha0 Print MM.I2C This generates 'Error : Invalid I2C address' If I preceed with 'On error skip" it returns 0 yet should be 1 according to the latest manual !? Without 'On error skip' it seems I can write say 20 random bytes to the FRAM yet reading back the 20 produces zero's and NO I2C2 ADDRESS ERRORS ?? Stumped, will continuity check SDA, SCL and power lines from my pico via RTC to the fram board tomorrow in daylight. Will also check the address should be A0 for the third time... |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5256 |
I2C address is 7 bits, Try &h50 Also Watch out, Some rtc modules have repro’s on the pcb, that could use &h50 as well Volhout PicomiteVGA PETSCII ROBOTS |
||||
DigitalDreams Newbie ![]() Joined: 03/05/2025 Location: United KingdomPosts: 34 |
Yes it's &h50 !. Think I was getting confused by the datasheet for the chip, implying 8 bits and consecutive addresses for read and write. Repro's ? To add confusion, repeatedly running my two 'I2C2 check's gives mostly 2 and 0 as responses to my trusty RTC and now FRAM but occasionally 2 and 2 are produced !?!?. Now for the grand finale.... I wrote 20 random numbers into the first 20 addresses starting at 0, then read the 20 back. It seemed to work at first till I repeated the program and looked closely. Certain addresses are occasionally messing up the data ???. Say writing 110 to address '3' comes back as 9 yet all the others are correct ?. On another occasion it's address '0' than corrupts. Yes addresses 0 and 3 intermittently corrupt. A bad chip ?, what about the I2C2 check giving a mix of 0 and 2 ?. Edited 2025-09-13 06:44 by DigitalDreams |
||||
DigitalDreams Newbie ![]() Joined: 03/05/2025 Location: United KingdomPosts: 34 |
UPDATE....Even stranger. Removed the two 'I2C2 check's at the start of my program and THE DATA READS BACK PERFECTLY EVERY TIME. Different random numbers written on every pass. 'I2C2 check' is broken ? |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2712 |
My guess is Volhout is referring to the solder pads that set the I2C address of the 24C32 chip on many RTC modules. Can be &H50 to &H57 . Edited 2025-09-13 08:14 by phil99 |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3412 |
My guess is EEProms, which many have. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5256 |
Just ideas Some I2C devices accept only 100kHz (slow) I2C Do you add pullups ? Fram is fast, but eeproms require time to write the data, I.e. 5ms Volhout Edited 2025-09-13 16:44 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |