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 : PULLUP not declared
Author | Message | ||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Rpi-Pico with WebmiteV5.07.08RC21 The doc's specifically state that I can do; SETPIN pin,mode,option yet I get an error message ?? at the prompt or in the program when I do Setpin GP18,CIN,PULLUP If I don't connect an external pullup, the input is just a spike. When I do, it looks like a square wave, so from that I have to conclude that it is not set automatically. Can SKS tell me where I am going wrong please. Regards Hervey Bay Qld. |
||||
gadgetjack Senior Member Joined: 15/07/2016 Location: United StatesPosts: 145 |
Are you using the system spi? That ties up gp18 in the manual. |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
Aren't the PULLUP and PULLDOWN options only for use with DIN? Manual, page 118 mentions these option under DIN use cases only. They are not mentioned for any of the other pin modes.... EDIT: Further to that, in the CIN section on the same page, it says that 'option' can be used to specify which edge triggers the count, but I don't think that means you can use PULLUP or PULLDOWN when the pin is configured for a counting input. Edited 2023-11-30 14:30 by Grogster Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6099 |
The pullup/pulldown resistance is 50k-80k Depending on the circuit feeding the pin, that will not be sufficient and external pullups would be required. I usually prefer external pullups so I know what I am dealing with. Not knowing the configuration or circuit, I don't know if that is the issue here. Edit Setpin GP18,CIN, , PULLUP The pullup option is after the count option. IF that is not set and you want pullups, you have to leave the placeholder. Jim Edited 2023-11-30 14:47 by TassyJim VK7JH MMedit MMBasic Help |
||||
disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 896 |
I think option is 1-5 when CIN is used. This is from my H7 manual but code was copied from Picomites, the picomite manual does mention 1-3 but i think all 5 are there. ‘option’ can be used to specify which edge triggers the count and if any pullup or pulldown is enabled 1 specifies a rising edge with pulldown, 2 specifies a falling edge with pullup, 3 specifies that both a falling and rising edge will trigger a count with no pullup or pulldown applied, 4 specifies both edges but with a pulldown and 5 specifies both edges but with a pullup applied. If ‘option’ is omitted a rising edge will trigger the count and a pulldown is enabled. Gerry Latest F4 Latest H7 |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6099 |
Thanks Gerry, spot on! I was wrong about the pullup after the option. I was in the process of testing the pullups and using option 2 does give a pullup of about 80K on my chip. Manual needs an update. Jim VK7JH MMedit MMBasic Help |
||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Thanks for the replies, but I am still none the wiser. Ideally I would use the internal pullup. So it sounds like we use the word PullUp for DIN and use the number 2 for CIN ?? Regards Hervey Bay Qld. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6099 |
Read Gerry's post. There a a number of options depending on leading edge/trailing edge, not just pullup/down. VK7JH MMedit MMBasic Help |
||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi All Thanks Jim, that's why I suggested 2 for pullup. How did you determine what the internal pullup was ? When I use option 2, I get 400mV with a 10:1 probe. That means 4v clock ?? When I used an external 10k pullup the clock was only about 2v. Considering a 3.3v system, should I be panicking with the 4v clock..? Edited 2023-11-30 16:21 by Dinosaur Regards Hervey Bay Qld. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6099 |
We are talking about an input. I don't know where oyu are getting your 'clock' from The rp2040 manual quotes pullup/down values of 50k to 80k Typically they are not true resistors and the picomite manual figure of 50uA is probably a better description. To test to see if the pullup was being applied I put a 12k resistor from the pin to ground with nothing else connected to the pin and measured the voltage. Old school methods sometimes are the easiest. If you are feeding 4V in, I hope you have plenty of spare chips. Jim VK7JH MMedit MMBasic Help |
||||
Dinosaur Guru Joined: 12/08/2011 Location: AustraliaPosts: 311 |
Hi Jim Terminology. Used the word clock for the input into GP18. However my input is not a voltage, it simply pulls the GP18 pin down to common. As a result of that I am seeing a 4V pulse being counted. If I use a resistor externally, then I used 10k from 3v3 out to GP18. Then I get about 2v pulses. Edited 2023-11-30 16:41 by Dinosaur Regards Hervey Bay Qld. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3802 |
Looking at the Picomite C source, I agree, all 5 look to be allowed. I'm not seeing that anything could be specified after that, so such as PULLUP doesn't look to be allowed. Sorry if I'm not seeing the right bit of code. John Edited 2023-12-02 00:59 by JohnS |
||||
Print this page |