Posted: 03:05am 16 May 2026 Copy link to clipboard
Bryan1 Guru
OK with the list system I2C I found if I took the I2C wires from the zero off the pico 2 I2C pins got the top one now the lower one is when I connected the zero I2C and the zero is unpowered.
Posted: 04:43am 16 May 2026 Copy link to clipboard
Bryan1 Guru
Well I thought as that regulator was getting hot it was toast so soldered up a new Mixtel board with a new zero.
Yet when I connect the zero's I2C pins to the pico 2 I2C pins the RTC I2C lines are lost, take off the zero I2C pins and the RTC is seen. I even got around to putting 4K7 pullups on with has made no difference.
Posted: 05:54am 16 May 2026 Copy link to clipboard
TassyJim Guru
I think you have to have the zero powered and the I2C set to slave when they are tied together.
Jim
Posted: 06:08am 16 May 2026 Copy link to clipboard
Bryan1 Guru
Jim I did do OPTION SYSTEM I2C GP14, GP15 on the zero and doing an option list shows the I2C there.
Now just had some fun found that led wasn't lighting and it turned out this lithuim battery after I gave it a good charge with this Ching board actually killed the battery so went and found my old AAA 4 battery pack and used that for power.
Powered it up with zero turned on by the 5V rail and it is still the same when the zero is connected the system I2C is clear, take the zero I2C wires out and the RTC is seen again.
Just looked at the manual and for the Option System I2C(2) there isn't an option to set it to slave.
Ok just found the I2C Apendix B in the manual and there is I2C Slave Open addrs, send_int, rvc_int.
So it does look like this needs to be in a program and not the command line so I need to make 2 subs and run the zero with the I2C wires off the pico 2 Edited 2026-05-16 16:27 by Bryan1
Posted: 07:25am 16 May 2026 Copy link to clipboard
Mixtel90 Guru
The on-board regulator on the Zero can provide a max of about 100mA (in addition to powering the RP2040). I usually keep it under that as the heatsink (the USB connector) isn't brilliant. If you keep within its limit things run cool, in my experience.
Do pay particular attention to the point I made about the USB supply NOT being isolated by a diode from the 5V pin though! You can damage some PCs by having this pin on a 5V supply while the USB lead is connected.
I would suggest: Power the Pico at 5V. Do not connect the 5V pin on the Zero. Link the GND and 3V3 pins on the two modules together, with the 3V3 via a jumper. Connect the I2C pullup resistors to the 3V3 supply from the Pico. Ideally the 3V3 from the Pico should have a diode to the 3V3 pin on the Zero rather than a jumper but that's introducing too much volt drop to be safe. The jumper allows you to program the Zero without powering the Pico and anything else attached to its 3V3.
It would really be better to use a 5V to 3V3 switcher and power both modules from that at 3V3. Disable the 3V3 reg on the Pico and don't connect the 5V, VBUS or VSYS pins. Something like the SO6 module is very cheap and can provide a solid 500mA, but any small buck regulator will do. This has several advantages. It reduces noise pick-up on the supply rail, reduces 3V3 rail impedance to reduce switching spikes and makes the power supply more flexible - you could power it with anything between 5V and 12V, smooth or not.
Posted: 07:36am 16 May 2026 Copy link to clipboard
TassyJim Guru
Just guessing again:
Don't use SYSTEM I2C on the module that is a slave. Setting SYSTEM I2C assumes that it will be a Master.
Just use SETPIN sda, scl, I2C/I2C2
Jim
Posted: 08:48am 16 May 2026 Copy link to clipboard
Bryan1 Guru
Well a big rethink about using the zero on I2C it was all around me using that lithium pack along with this ching charger, now that I've killed the battery the idea of battery management is off the table.
My Sprint layout should be ready to FAB but still go to put in the console output and a passive board designed to use Lyle's circuit with the opto's made and provide a 12 volt input to the 5V reg, now I do have some some 3V3 reg's too so one of them could be used.
Then tomorrow I can setup the BC337's for the stepper outputs along with the 22K and 1K resistors then put in the stepper code to my program so this project cam move forward.
So what I'm thinking is getting the stepper INIT code in early then the 3 display box's I setup in the code can actually show the position of the machine instead of the 0.000 String I put in.
Then when the display box on each axis can be used as the _pos for the stepper code and the DIR can be set and made a string by using the toggle switch so DIR will be 1 or 0 and move the distance of the _pos string depending on the axis.
I do think another displaybox should be made so the feedrate can be assigned to the F_pos for the stepper string.
Once this is all done I should be able to move each axis to establish the actual position of the machine.
There is still a longway to go and getting the steppers to move in my code will get it over V0.01
Now once the X axis and Y axis stepper code is sorted out where the X axis is just going back and forwards and be a constant distance as we only need to clear the magnetic table and the Y axis is just going to increment depending on the grinding wheel width.
I do think that will be the version update as the X axis and Y axis is sorted then comes the Z axis where a grinding wheel is doing 2,500 rpm depending on the diameter and depth of cut where if any problems are in use the E_Stop will cut the Y axis and X cam move away from the magnetic table leave so in reality the Z axis should raise to clear the job so the E_Sop is only to stop the job.
Now with surface grinding depending on the job only a few pass's are needed where the depth of cut can be measured in steps rather than distance then we need to turn the job over. So the E_Stop function can be used for changing the work setting then a new run page on the lcd can move the stepper step by step to get the grinding started.
Now I am thinking about the limit switch's as they won't be needed as the Y axis is just going to clear each side of the magnetic table and for a X axis the magnetic table is 1/2 the X axis travel.
The Z axis travel will only really move when a smaller grinding is put on but again in reality if we use the same diameter grinding wheel the Z axis is only going to move a small difference so referencing the limits in the code would do which would bring 3 in/outs free which could be used for enable pins.
So Lyle how does sound to you mate and can I wake up tomorrow morning seeing that you updated my code to work with the stepper code so I have to wire up the X and Y axis to the DM556's to test the code.
Regards Bryan
Posted: 05:16pm 16 May 2026 Copy link to clipboard
Mixtel90 Guru
Unless your application needs speed you may well be able to drop the CPU speeds, which also drops the current consumption if that's important. 48MHz is still blindingly fast - they will still spend most of the time waiting for something to happen.
Posted: 03:06am 17 May 2026 Copy link to clipboard
mozzie Guru
G'day Bryan, Sorry to say a 50th last night + a few too many bevvies + getting home at 05:30 means any programming today would be null and void
Happy to have a look later today (hmmm maybe) or tomorrow and see what I can come up with
Regards, Lyle.
Posted: 07:18am 17 May 2026 Copy link to clipboard
phil99 Guru
Happy Birthday Lyle!
I guess this isn't needed now but here is a workaround for the I2C Slave freeze issue. Hopefully a future firmware version won't need it. In the meantime it would be helpful if the problem could be mentioned in the manual.
' I2C slave program with antifreeze Dim integer SDApin = mm.info(pinno GP0), SCLpin = mm.info(pinno GP1) 'choose your pins
SetPin SDApin, SCLpin, I2C I2C SLAVE OPEN &H52, TXint, RXint 'Transmit and receive ISRs Dim Integer RXbytes = 8 'set the number of bytes to receive
Do : Pause 5 : Loop Until Inkey$<>"" 'main loop
Sub RXint count, a$ I2C SLAVE READ RXbytes, a$, count Print Left$(a$, count), count End Sub
Sub TXint Local a$ = DateTime$(now) 'data to send
I2C SLAVE WRITE Len(a$), a$ Pause len(a$) / 33 'allow time for Write to complete
If MM.I2C Then 'close and re-open I2C if requested bytes <> len(a$) I2C close SetPin SDApin, SCLpin, I2C I2C SLAVE OPEN &H52, TXint, RXint EndIf
Print "Slave sent = ";a$ End Sub
Print "End"
End
I2C Master testing console program. The slave program above will be sending 19 bytes when requested. These are the output when 19, 30 and 10 bytes are requested, 6 times each to show success isn't a fluke.
> SetPin GP12, GP13, I2C : I2C OPEN 100, 1000 > A$="" : For n=0 To 5 : I2C read &H52, 0, 19 ,A$ : Print A$ : pause 999 : Next 17-05-2026 16:48:07 'requesting the correct number of bytes, 19 17-05-2026 16:48:08 17-05-2026 16:48:09 17-05-2026 16:48:10 17-05-2026 16:48:11 17-05-2026 16:48:12 > 'requesting the wrong number, 30 > A$="" : For n=0 To 5 : I2C read &H52, 0, 30 ,A$ : Print A$ : pause 999 : Next 17-05-2026 16:48:41ÿÿÿÿÿÿÿÿÿÿÿ 17-05-2026 16:48:42ÿÿÿÿÿÿÿÿÿÿÿ 17-05-2026 16:48:43ÿÿÿÿÿÿÿÿÿÿÿ 17-05-2026 16:48:44ÿÿÿÿÿÿÿÿÿÿÿ 17-05-2026 16:48:45ÿÿÿÿÿÿÿÿÿÿÿ 17-05-2026 16:48:46ÿÿÿÿÿÿÿÿÿÿÿ > 'requesting the wrong number, 10 > A$="" : For n=0 To 5 : I2C read &H52, 0, 10 ,A$ : Print A$ : pause 999 : Next 17-05-2026 17-05-2026 17-05-2026 17-05-2026 17-05-2026 17-05-2026 >
Edit. the "ÿ" bytes are 255
As the freeze only occurs after the data has been successfully sent it would appear matching the requested number of bytes with the number of bytes to be sent isn't really required. So perhaps this is the result of a bug rather than improper use in a program. Edited 2026-05-17 21:01 by phil99
Footnote added 2026-05-18 08:40 by phil99 Bugs now fixed in v6.03.00RC9, including I2C READ accepting a 1 byte string.
Footnote added 2026-05-18 09:12 by phil99 Using RC9 to check for errors. When the Master requests double the number of bytes available from the slave the data is repeated, so compare the two halves.
Posted: 01:51am 18 May 2026 Copy link to clipboard
Bryan1 Guru
Well that 4" lcd turned up this morning soldered on the 4 pin connector for the SDCard and replaced the ILI9488 with the new ST7796, now in the manual it stated the lcd driver is a ST7796S so used that for the option lcdpanel.
Now I took off that 10K diode hack for the ILI9488 and left MISO unconnected, did a clear flash and installed RC9 and after putting the options in everything just worked
Now also I did read this lcd can work on 3V3 by jumpering J1 and bridging D1 so haven't done that yet. Now with just the USB cable connected there is just over 4 volts on the Vcc bus and with the suggestions of going 3V3 it does make sense as for testing the usb cable won't be connected and the circuit can run of those 4 off AAA batteries in series and I want to replace the 5V regulator with a 3V3 one so would I need to put a diode on the 3V3 regulator to stop the higher USB voltage damaging the 3V3 regulator.
Now I just did a reboot and saw both the LCD screen and MCCC off on it's own tangent
Doing the reboot fixed the problem so not sure why on a reconnect it went straight to B drive then to A drive, Also it tried to do a gui test lcdpanel.
O'well still got to wire up those push buttons to emulate the E_Stop and limits and load the 2040 RC9 on the zero so I try the fix for the I2C.
Now it does look like that 2032 button battery is gone as the RTC won't keep time when powered down.
Regards Bryan
Regards Bryan
Posted: 05:15am 18 May 2026 Copy link to clipboard
Volhout Guru
OPTION RTC AUTO ?
Volhout
Posted: 05:24am 18 May 2026 Copy link to clipboard
Now I'm playing with my code and found page 5 wasn't responding to a button press so I put in down to a sloppy calibration and did a option reset and found with more careful press's on the calibration did fix the problem. Now with this 4" screen about 6mm on the right of the screen is blanked out so I need the command the command to widen the resoultion. Edited 2026-05-18 15:30 by Bryan1
Posted: 05:28am 18 May 2026 Copy link to clipboard
phil99 Guru
RTC GETTIME : ? DateTime$(now)
Will tell you if the RTC is running. If it is then as Volhout wrote:-
OPTION RTC AUTO enable . Edited 2026-05-18 15:28 by phil99
Posted: 05:31am 18 May 2026 Copy link to clipboard
[20] Stepper axis Y, GP4, GP5, GP1,, 600,, Error : Pin 2/GP1 is in use
doing a list pins
[CODE> list pins GP0 1 OFF GP1 2 DOUT: Reserved for function GP2 4 DOUT: Reserved for function GP3 5 DOUT: Reserved for function GP4 6 DOUT GP5 7 DOUT GP6 9 OFF GP7 10 OFF GP8 11 OFF GP9 12 OFF]
Now no where in my code have I set any pins
Posted: 06:24am 18 May 2026 Copy link to clipboard
Stepper initialized - 100KHz timer active Warning: Soft limits not configured. Use STEPPER LIMITS to set working area. [28] Stepper axis Y, GP4, GP5, GP1,, 600,, Error : Pin 2/GP1 is in use
So why won't the pico 2 let me use these pins, thinking it could be as I set GP1 to enable X and it saying can't use a single enable pin for X,Y and Z Edited 2026-05-18 16:27 by Bryan1
Posted: 06:26am 18 May 2026 Copy link to clipboard
phil99 Guru
Option List should indicate if anything there is using them. If nothing is then at the command prompt enter:- setpin gp1,off : setpin gp2,off : setpin gp3,off
Then try again.
Posted: 06:29am 18 May 2026 Copy link to clipboard
Bryan1 Guru
> setpin gp1, off : setpin gp2 off : setpin gp3 off Error : Pin 2/GP1 is in use