|
Forum Index : Microcontroller and PC projects : Stepper Project
| Author | Message | ||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 1972 |
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. > list system i2c HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > ? time$ 01:42:47 > RTC settime 2026, 05, 16, 12, 30, 0 > ? time$ 12:30:08 > list system i2c HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- - |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 1972 |
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. |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6523 |
I think you have to have the zero powered and the I2C set to slave when they are tied together. Jim VK7JH MMedit |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 1972 |
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 |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8830 |
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. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6523 |
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 VK7JH MMedit |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 1972 |
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 |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8830 |
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. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |