Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:39 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Onboard LED

Author Message
Malibu
Senior Member

Joined: 07/07/2018
Location: Australia
Posts: 228
Posted: 10:01pm 14 Oct 2023
Copy link to clipboard 
Print this post

G'day all, I'm running a Webmite with Version 5.070804

I'm trying to control the onboard LED to flash at different rates determined by what's happening in the code.
Following this in the manual -
  Quote  Pins that are not exposed on the Raspberry Pi Pico can still be accessed using MMBasic via a pseudo pin
number or their GPn number. This allows MMBasic to be used on other modules that use the RP2040
processor. These hidden pins are Pin 41 or GP23, Pin 42 or GP24, Pin 43 or GP25 and Pin 44 or GP29.
On the Raspberry Pi Pico these pins are used for internal functions as follows:
 Pin 41 or GP23 is a digital output set to the value of OPTION POWER. (ON=PWM, OFF=PFM).
 Pin 42 or GP24 is a digital input, which is high when VBUS is present.
 Pin 43 or GP25 is also PWM4B. It is an output connected to the on-board LED.
 Pin 44 or GP29 is also ADC3 which is an analog input reading ⅓ of VSYS.

and....
  Quote  SETPIN GP25, DOUT |
HEARTBEAT
This version of SETPIN controls the on-board LED.
If it is configured as DOUT then it can be switched on and off under
program control.
If configured as HEARTBEAT then it will flash 1s on, 1s off continually
while powered. This is the default state and will be restored to this when the
user program stops running.


with this code...

option heartbeat off

? mm.info$(pin 43)
const LED = 43
setpin LED, dout

do
 pin(LED) = not pin(LED)
 pause 500
loop


results with (In the MMCC)...
  Quote  RUN
Invalid
[8] SetPin LED, dout
Error : Pin 43/able name too long is invalid
>  


Am I missing something? I can only find 4 references to gp25 and I read it as disabling the HeartBeat releases gp25 as a usable output (Although, not physically accessible)
John
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6099
Posted: 10:10pm 14 Oct 2023
Copy link to clipboard 
Print this post

Things are different for the WEBmite

From the WEBmite manual
  Quote  Some RP2040 GPIO pins are used for internal board functions:
 GP29 (Input/Output) wireless SPI CLK/ADC mode (ADC3) measures VSYS/3
 GP25 SPI CS (Output) when high also enables GPIO29 ADC pin to read VSYS
 GP24 (Input/Output) wireless SPI data / IRQ
 GP23 (Output) wireless power-on signal
Unlike the original Raspberry Pi Pico, the on-board LED on Pico W is not connected to a pin on RP2040, but
instead to a GPIO pin on the wireless chip and cannot be accessed from a BASIC program.


Jim
VK7JH
MMedit   MMBasic Help
 
Malibu
Senior Member

Joined: 07/07/2018
Location: Australia
Posts: 228
Posted: 10:19pm 14 Oct 2023
Copy link to clipboard 
Print this post

Thanks Jim, much appreciated!

That's perfectly clear now, and it looks like I've been referencing the wrong manual all along!
John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024