Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:48 30 Sep 2022 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 : RP2040 Pico Temperature sensor Not supported

     Page 1 of 3    
Author Message
scott14468
Newbie

Joined: 18/07/2022
Location: United States
Posts: 4
Posted: 05:39pm 17 Sep 2022
Copy link to clipboard 
Print this post

Hi All,

The RP2040 Pico has an internal temperature sensor (e.g. a transistor junction), that is monitored by ADC channel 5.  Picomite doesn't seem to support its use by not allowing the fifth channel to be opened.  Any plans to include this?


Scott
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6491
Posted: 05:49pm 17 Sep 2022
Copy link to clipboard 
Print this post

Check the PIN function in the manual
 
scott14468
Newbie

Joined: 18/07/2022
Location: United States
Posts: 4
Posted: 05:32pm 18 Sep 2022
Copy link to clipboard 
Print this post

what do you mean check the pin function?  There's no pin associated with the temperature channel.

Scott
 
Bleep
Regular Member

Joined: 09/01/2022
Location: United Kingdom
Posts: 78
Posted: 05:38pm 18 Sep 2022
Copy link to clipboard 
Print this post

Page 127 of the manual, or simply search for temperature, or 'PIN' that's all I did!
Edited 2022-09-19 03:41 by Bleep
 
scott14468
Newbie

Joined: 18/07/2022
Location: United States
Posts: 4
Posted: 05:43pm 18 Sep 2022
Copy link to clipboard 
Print this post

Thanks!  I just stumbled across it in the BASIC manual!

Scott
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2010
Posted: 05:44pm 18 Sep 2022
Copy link to clipboard 
Print this post

  Quote  PIN(TEMP)         Returns the temperature of the RP2040 chip.


folks around here love giving cryptic answers  


cheers,
rob   :-)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6491
Posted: 06:29pm 18 Sep 2022
Copy link to clipboard 
Print this post

  Quote  folks around here love giving cryptic answers


It wasn't cryptic it was concise and accurate. I don't think spoon feeding is the best response to questions. It may have not been obvious that the PIN function was the way this was implemented so it is understandable that it may be missed in the manual but it is there and moreover I took the trouble to check it was both in the manual and worked before posting a clear response
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 08:18pm 18 Sep 2022
Copy link to clipboard 
Print this post

  Bleep said  Page 127 of the manual, or simply search for temperature, or 'PIN' that's all I did!


page 127 of which manual?
I spent time looking for adc(4).
read picomite temp on a plate please
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 08:51pm 18 Sep 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  folks around here love giving cryptic answers


It wasn't cryptic it was concise and accurate. I don't think spoon feeding is the best response to questions. It may have not been obvious that the PIN function was the way this was implemented so it is understandable that it may be missed in the manual but it is there and moreover I took the trouble to check it was both in the manual and worked before posting a clear response


What is the point of help if it is learn to help yourself?
If users knew the answers then they would not ask questions.
Just read the manual is not enough sometimes. Sorry. No mind police yet.
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 09:13pm 18 Sep 2022
Copy link to clipboard 
Print this post

How do I search for pin(TEMP) please? Or any thing in a pdf?
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 09:13pm 18 Sep 2022
Copy link to clipboard 
Print this post

How do I search for pin(TEMP) please? Or any thing in a pdf?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 4892
Posted: 09:13pm 18 Sep 2022
Copy link to clipboard 
Print this post

  stanleyella said  
What is the point of help if it is learn to help yourself?
If users knew the answers then they would not ask questions.
Just read the manual is not enough sometimes. Sorry. No mind police yet.





It's in every picomite and picomiteVGA manual that I looked in.


The first thing I was told at Uni was: "You are not hear to learn to be engineers, you are here to learn how to learn"

It is still relevant.
Being pointed to where to find the answer is the right thing to do.

Jim

  Quote  How do I search for pin(TEMP) please? Or any thing in a pdf?

Start with a PDF viewer that has  a search function, or use the index.
Edited 2022-09-19 07:16 by TassyJim
VK7JH
MMedit   MMBasic Help
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 2975
Posted: 09:32pm 18 Sep 2022
Copy link to clipboard 
Print this post

I open PDF files in Edge. If you go to the top the menu drops down. There's a magnifying glass for Find. You can search for anything using that.

The manual is *always* the first port of call. Most things that have been asked are in there. It really doesn't help to give people the answers to things that are already in the manual because it only encourages them to ask about even more mundane things. Simply reading the manual a couple of times will help an awful lot. Yes, sometimes you miss stuff and get stuck. It happens to all of us.

Also, if you are having a problem with something just try a tiny and otherwise useless program to test what a command does.
Edited 2022-09-19 07:38 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 09:53pm 18 Sep 2022
Copy link to clipboard 
Print this post

I can not find any reference to reading temperature using picomite manual.
Please post the relevant info instead of my futile searches.
Using picomite non vga manual. sorry did not quote
"PIN( pin ) = value For a ‘pin’ configured as digital output this will set the output to low
(‘value’ is zero) or high (‘value’ non-zero). You can set an output high or
low before it is configured as an output and that setting will be the default
output when the SETPIN command takes effect.
See the function PIN() for reading from a pin and the command SETPIN for
configuring it. Refer to the chapter "Using the I/O pins" for a general
description of the PicoMite's input/output capabilities.

Using the I/O pins
The Raspberry Pi Pico has 26 input/output pins which can be controlled from within the BASIC program with 3
of these supporting a high speed ADC (Analog to Digital Converter).
An I/O pin is referred to by its pin number and this can be the number (e.g., 2) or its GP number (e.g., GP1).
Digital Inputs
A digital input is the simplest type of input configuration. If the input voltage is higher than 2.5V the logic
level will be true (numeric value of 1) and anything below 0.65V will be false (numeric value of 0). The inputs
use a Schmitt trigger input so anything in between these levels will retain the previous logic level. All pins are
limited to a maximum voltage of 3.6V. This means that resistor divider will be required if they are used with
input voltages greater than that.
In your BASIC program you would set the input as a digital input and use the PIN() function to get its level.
For example:
SETPIN GP4, DIN
IF PIN(GP4) = 1 THEN PRINT "High"
The SETPIN command configures pin GP4 as a digital input and the PIN() function will return the value of that
pin (the number 1 if the pin is high). The IF command will then execute the command after the THEN
statement if the input was high. If the input pin was low the program would just continue with the next line in
the program.
The SETPIN command also recognises a couple of options that will connect an internal resistor from the input
to either the supply or ground. This is called a "pullup" or "pulldown" resistor and is handy when connecting to
a switch as it saves having to install an external resistor to place a voltage across the contacts.
Analog Inputs
Pins marked as ADC can be configured to measure the voltage on the pin. The input range is from zero to 3.3V
and the PIN() function will return the voltage. For example:
> SETPIN 31, AIN
> PRINT PIN(31)
2.345
>
You will need a voltage divider if you want to measure voltages greater than 3.3V. For small voltages you may
need an amplifier to bring the input voltage into a reasonable range for measurement.
The measurement uses 3.3V power supply to the CPU as its reference and it is assumed that this is exactly
3.3V. This value can be changed with the OPTION command.
The ADC commands provide an alternate method of recording analog inputs and are intended for high speed
recording of many readings into an array.
Counting Inputs
Any four pins can be used as counting inputs to measure frequency, period or just count pulses on the input.
The pins used for this function can be configured using the OPTION COUNT command but, if not changed,
will default to GP6, GP7, GP8 and GP9.
As an example, the following will print the frequency of the signal on pin GP7:
> SETPIN GP7, FIN
> PRINT PIN(GP7)
110374
>
In this case the frequency is 110.374 kHz.
By default the gate time is one second which is the length of time that MMBasic will use to count the number
of cycles on the input and this means that the reading is updated once a second with a resolution of 1Hz. By
specifying a third argument to the SETPIN command it is possible to specify an alternative gate time between
10ms and 100000ms. Shorter times will result in the readings being updated more frequently but the value
PicoMite User Manual Page 26
returned will have a lower resolution. The PIN() function will always scale the returned number as the
frequency in Hz regardless of the gate time used.
For example, the following will set the gate time to 10ms with a corresponding loss of resolution:
> SETPIN GP7, FIN, 10
> PRINT PIN(GP7)
110300
>
For accurate measurement of signals less than 10Hz it is generally better to measure the period of the signal.
When set to this mode the PicoMite will measure the number of milliseconds between sequential rising edges
of the input signal. The value is updated on the low to high transition so if your signal has a period of (say) 100
seconds you should be prepared to wait that amount of time before the PIN() function will return an updated
value.
The count pins can also count the number of pulses on their input. When a pin is configured as a counter (for
example, SETPIN 7,CIN) the counter will be reset to zero and PicoMite will then count every transition from
a low to high voltage. The counter can be reset to zero again by executing PIN(7) = 0."
Edited 2022-09-19 07:55 by stanleyella
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6491
Posted: 10:04pm 18 Sep 2022
Copy link to clipboard 
Print this post

  Quote  I can not find any reference to reading temperature using picomite manual.


Check the PIN function in the manual (in the FUNCTIONS section !!!!!
 
Glen0
Regular Member

Joined: 12/10/2014
Location: New Zealand
Posts: 56
Posted: 10:22pm 18 Sep 2022
Copy link to clipboard 
Print this post

PicoMite User Manual
MMBasic Ver 5.07.04
Rev 3
Pg 130

PIN( TEMP )
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 348
Posted: 10:27pm 18 Sep 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  I open PDF files in Edge. If you go to the top the menu drops down. There's a magnifying glass for Find. You can search for anything using that.

The manual is *always* the first port of call. Most things that have been asked are in there. It really doesn't help to give people the answers to things that are already in the manual because it only encourages them to ask about even more mundane things. Simply reading the manual a couple of times will help an awful lot. Yes, sometimes you miss stuff and get stuck. It happens to all of us.

Also, if you are having a problem with something just try a tiny and otherwise useless program to test what a command does.


I do not use edge. I use opera. win10. manual msword pdf.
The manual is comprehensive but values for commands can be misinterpreted.
I think showing real numbers as an example would be more helpful sometimes.
I am reading every page even how to access each bit in an integer. (1 bit sound).
The manual is where I go first but sometimes I can not find the answer and "mmbasic demos" is not in a format I am used to.

asking the forum is better than a road to nowhere
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2336
Posted: 12:10am 19 Sep 2022
Copy link to clipboard 
Print this post

In Opera:


PicoMite on fruitoftheshed
 
Rickard5

Senior Member

Joined: 31/03/2022
Location: United States
Posts: 251
Posted: 03:02am 19 Sep 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  folks around here love giving cryptic answers


It wasn't cryptic it was concise and accurate. I don't think spoon feeding is the best response to questions. It may have not been obvious that the PIN function was the way this was implemented so it is understandable that it may be missed in the manual but it is there and moreover I took the trouble to check it was both in the manual and worked before posting a clear response


OK as Chief Architect and Maintainer of the code unless there's some subscription service no one told me about, I'm just Damn Grateful for any info
The days that I keep my gratitude Higher than my expectations, and Well, I have really good days
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1553
Posted: 04:06am 19 Sep 2022
Copy link to clipboard 
Print this post

Matherp said
  Quote  Check The PIN function in the manual.

So I tried it.
It took less than 20 seconds for me to find
  Quote  PIN( TEMP ) Returns the temperature of the RP2040 chip (see the RP2040 data sheet for
the details)

I can't see a problem.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
     Page 1 of 3    
Print this page
© JAQ Software 2022