|
Forum Index : Microcontroller and PC projects : 1st MMBasic project, RTC, OLED, introducing myself
| Author | Message | ||||
| steview_de Newbie Joined: 02/11/2022 Location: GermanyPosts: 12 |
Hey folks, i am not only asking, but also doing! First small steps ... After destroying 3(?) "Pies" due to "I don't know what", i "reactivated" them. I think that there was an overload on two pins due to the oszilloscope i connected. But anyway, i marked the broken pins and use other ones. (This is the reason, because you see a white dot beneath the RP2040 chip in the clip below). It's not a great deal, but for a real beginner .... Okay, honestly, i tried for some weeks on MMBasic, not the whole time due to other hobbies. I just want to test if the realtime clock and the OLED are working on the I2C Bus. So i need another voltage supply ... well i found an old power bank battery ;-) As an engieer for automotive projects i have not really contact to "bits and bytes". In my "former life" i was a automobile mechanics. In school times, some ... 35 years ago, i made my first tries with BASIC on an Amstrad CPC 6128. So i found some parallels to MMBasic. That's all for now an i hope we will deal with eac other. Regards from Germany Stefan aka "Stevie" Short clip on YT Edited 2022-12-04 23:04 by steview_de |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2681 |
Hi steview_de. I am a newbie. Started using mmbasic with rpi pico this year. Rpi pico is 3.3V logic. 5V on a gpio pin will break rpi pico. There is a 5V out pin on the pico but depends on current usb power to pico. |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8304 |
VBUS is 5V output from the USB input. You can use it as 5V out, but it's of limited use. You can also use it as 5V input, but not if the USB connector is used as you could damage the PC's USB port. The VSYS pin feeds an on-board voltage regulator to give the 3V3 supply (on the 3V3 pin). Use that 3V3 supply (and nothing else) for *all* I/O until you know what you are doing! The Picomite can't handle 5V on any of its input pins (it kills them immediately) and the output current is also very limited (see the manual). The absolute maximum voltage on any pin is 3V6. If you take a little care the PicoMite is actually reasonably rugged. I've not managed to blow one up yet. (I will now - just watch!) Connecting an oscilloscope to any of the pins won't damage anything (unless you've done something funny with the GND pins and short-circuited the power supply). Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2681 |
You have i2c working. Is the problem a 5V logic level device? I do not know about meter voltage or psu or amstrad I use https://www.ebay.co.uk/itm/175518717722?hash=item28ddbb171a:g:rhkAAOSwRW9cz9QE&amdata=enc%3AAQAHAAAA4DjWBGkIye224I%2FTEcPBzyyC0XEwPsFricmx7IQqY8k8jd%2Floy4JdEipfUXp8p0f8Nkqpi%2FSf8VcDD66GNKk0UffovWXrh1tLrf90NP018hwk7qQf5kJ18Msq31%2BMRJ%2FwdCnLA30%2FAb2zoJwYSE7sSP%2BHltYDCEOO%2Bnq2XeJDis3nVeIiV6zPNDBkb%2FaT7MGlyd8V2hMGMjNmU7EIoFrhNZ3uRr6t59tH0vkpzqhaqmVz4sY89Z27e0Y5h0yq5cvxXmY8yK9%2Fc8YBrSNCZq0C80vGHHQbuTYTQnyTML8Q4e0%7Ctkp%3ABFBMyqzz65th |
||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
As lizby(IIRC) has pointed out, there is no need for these horribly long links. Anything beyond and including the "?" can be deleted: https://www.ebay.co.uk/itm/175518717722 Even better as an embedded link |
||||
| steview_de Newbie Joined: 02/11/2022 Location: GermanyPosts: 12 |
Hey, i know 'bout 3.3 and 5V logic. I destroyed the Picos because of .... "lack of security" ;-) Don't try to change jumper wires under voltage! And with the oszi ... i think i created a short circuit. At the moment, everything works fine. "Stevie" |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8304 |
:) It's just that some people come from a 5V world and figure that, because you can feed a PicoMite from 5V then you can also use 5V for I/O. It doesn't work like that. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2681 |
"It's just that some people come from a 5V world" Did the trs80 use 5V logic? It was 8 bit ucontrollers at 5V logic at one time the norm, although an 8 bit pic can be powered at 3.3V and will then use 3.3V logic. ILI lcd use 3.3V logic so some people mess up using pic/avr. LGT 328 works at 3.3V logic like rpipico but many devices like things you connect to gpio are 5V logic. Stevie realises this, some people do not and break devices. The rpipico has been resilient to my wiring errors.. just lucky so far :) |
||||
| steview_de Newbie Joined: 02/11/2022 Location: GermanyPosts: 12 |
... okay, let's continue with easy coding ;-) RTC GETTIME SETPIN GP15, DIN, PULLUP SETPIN GP26, AIN DO IF PIN(GP15) = 0 THEN VMON TEXT 64, 1,TIME$, C TEXT 64,15,DATE$, C LOOP SUB VMON CLS TEXT 64,1, "Button pressed", C PAUSE 1000 CLS TEXT 1,1, Str$(PIN(GP26)*1.3965 ,2,4) TEXT 128,1, "Volt", R PAUSE 2000 CLS END SUB The result, you can see ... here At the moment there is an issue with the correct and stable voltage, shown on the display. It is changing in a range of about 0.01 Volts, up and down. Any ideas how to manage it? Refernece voltage? But from where? "Stevie" Edited 2022-12-06 04:35 by steview_de |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10629 |
The RP2040 is c..p due to a silicon bug which creates non-linearity in the readings. It is good for somewhere between 7.5 and 8 bits resolution. 3.3V/256= c0.01 volts so you are doing as well as the chip can support. The firmware oversamples 10x and discards the highest and lowest reading before averaging the rest to try and improve things. In addition you can use an external low impedance reference on pin 35 of say 3V (use OPTION VCC 3.0 in your program if doing this). Finally the ADC is much better if you use a linear supply for the 3.3V supply to the Pico (ground pin 37 to disable the switching regulator and supply 3.3V to pin 36) |
||||
| steview_de Newbie Joined: 02/11/2022 Location: GermanyPosts: 12 |
Peter, thanks! Please allow me one question: What do you mean with "low impedance" reference? Thanks in advance an kind regards "Stevie" |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2681 |
"low impedance" a reference diode maybe or a reference voltage that does not be a resistance or an inductor... I think about microphones 600 ohm impedance or low impedance speakers ie 4 ohm. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10629 |
e.g. LM4040-3.0 |
||||
| PeterB Guru Joined: 05/02/2015 Location: AustraliaPosts: 655 |
G'Day All. I think some clarification is in order. A voltage source can be high impedance, low impedance, stable, unstable and it all depends on what you are trying to do. A source is low impedance if it does not change MUCH when loaded. It all depends on how much is too much. A source is stable if its output remains constant over time, that is, it does not wander MUCH over time. Again, how much is too much. There are other things to consider like transient response but big electros and good design keep most things in good shape. For you blokes getting started it can be a bit of a worry but don't let it get to you. The learning phase is the fun bit :-) Peter |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8304 |
@Stan: Yep - the TRS-80 used 5V logic, with my favourite CPU - the Z80. :) @Stevie: If you connect a LM4040 3V0 voltage reference (they are similar to a zener diode in concept, but are more complicated inside) from VREF down to GND it will pin the analogue reference voltage to 3V0 instead of 3V3. Using OPTION VCC 3.0 in your program corrects MMBasic so that the analogue inputs still read the correct voltage (but now 3V0 is the maximum input). Because the reference voltage is now 0.3V below the supply line any supply line noise is reduced, leading to better ADC performance. The LM4040 has enhanced characteristics over a zener and is based on a band gap reference. The operation curve is much more precise and the output is more stable. Supply impedances: Any supply has an internal resistance. This is comprised of two parts, there's a straight DC resistance and a "pulse" capability (AC impedance). It's possible to have a supply that can handle pulses of current but will sag under constant load or one that is fine with constant loads but hasn't got the capacity to give pulses - the voltage sags. Most supplies are somewhere between these. If a supply can handle pulses of current we say that it has a low impedance - it can look like a bigger supply than it really is. Adding a capacitor across a zinc-carbon battery does this, as does adding decoupling capacitors in a circuit. The LM4040 "looks like" a low impedance supply to the VREF input, even though it is being supplied via a 200R resistor. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| steview_de Newbie Joined: 02/11/2022 Location: GermanyPosts: 12 |
Thanks to all of you!! "Stevie" |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |