Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:20 01 May 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 : momentary button with MMbasic 4.5

Author Message
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 06:07pm 24 Jan 2016
Copy link to clipboard 
Print this post

I have a momentary push button connected to the earth with a 100n cap connected in parrellel with it as shown in this pic...


In MMbasic 4.5 when I specify

setpin BUTTON, DIN, PULLUP, OnButton


it doesn't reconize the PULLUP keyword, so I have omitted it..

When I wave my hand over it from about 10cm above it.. it will activate the OnButton interrupt and run that code... I haven't even pressed the button...

Oh yeah the code I used is

setpin BUTTON, INTL, OnButton


any ideas on how to fix it?

Thanks for the replies
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 813
Posted: 08:19pm 24 Jan 2016
Copy link to clipboard 
Print this post

Hi Troyfa,

you MUST use a pullup!!! It's equal if you use the internal one or if you connect a external pullup! Try a 10K to 3V3. Your signal line is floating and reacts in other respects to your hand or similar disturbances.

Frank
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1328
Posted: 08:44pm 24 Jan 2016
Copy link to clipboard 
Print this post

Welcome to TBS Troya.

EDITED: mistakes in the explanation - below is correct.

As Frank says you need an external pullup. The programmed PULLUP etc. option is also not available in the Minimite (actually called the Mini-Maximite) or the Maximite, i.e. the MMBasic used for the MX695 and MX795 chips. It is only available for the later Micromites, i.e. the MMBasic running on the MX170 and MX470 chips (and a couple of others).

When you downloaded MMBasic V4.5 did you also download the manual? The later versions of the Maximite/Mini-Maximite software had two manuals, one for hardware and one for software. The MMBasic V4.5 software manual is called the "MMBasic Language Manual". There are quite a few differences to MMBasic for the Micromites that you'll need to know.

BTW, your bottom line of code looks fine for V4.5

Greg
Edited by paceman 2016-01-26
 
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 10:25pm 25 Jan 2016
Copy link to clipboard 
Print this post

Thanks for the replies Paceman and Frank...

I will give it a try...

Yeah I read all the manuals, but I did download quite a few MMbasic firmware stuff...
 
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 10:26pm 25 Jan 2016
Copy link to clipboard 
Print this post

..Edited by Troyfa 2016-01-27
 
Print this page


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

© JAQ Software 2024