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 : Urgent Maximite help needed
Author | Message | ||||
BrianP Senior Member Joined: 30/03/2017 Location: AustraliaPosts: 292 |
Hi gurus I am trying to get the keypad function to work on a colour Maximite without success. Whatever I try it won't work, as per simple test program below. Before I resort to self harm can someone suggest what I might be doing wrong? The manual states any pins can be used. Version is CMM V4.5. Thanks (hopefully) in advance... Brian P. 'test program keypad KeyCode, KP_Int, 1, 2, 3, 4, 5, 6, 7 '4x3 keypad as per manual example do loop end ' KP_Int: ? "key press = " KeyCode 'this as per manual example ireturn ' >run [3] Keypad KeyCode, KP_Int, 1, 2, 3, 4, 5, 6, 7 '4x3 Error: Invalid configuration |
||||
cosmic frog Senior Member Joined: 09/02/2012 Location: United KingdomPosts: 278 |
Not sure but I don't think you can use the keypad on the Maximite, I think it was only supported by the Micromite. I'll have to check. Just checked and yes it is used on the Maximite. It's been that long since I've used it. Dave. |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
I think I agree with Cosmic - I looked in the manual for version 4.4 of MMBASIC for the Maximite, and that command does not seem to exist, so you might be out of luck. The "Invalid configuration" error you are getting, is misleading. MMBASIC is moaning that that command line is invalid, probably because it cannot find a sub-routine called "KEYPAD", so it falls over at the command prompt. The way it is worded suggests you have a valid command, but the syntax is wrong. I think it is that MMBASIC cannot find the KEYPAD sub, so cannot pass the arguments to said sub, so that is an "Invalid configuration" in that you can't pass arguments to a non-existent SUB, in the case of MMBASIC 4.4 for the MAXIMITE series. I think that is what is going on with the error anyway. Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
Where did you find that info and what version of MMBASIC for the Maximite series? It's been that long for me too....... EDIT: I stand corrected. As Cosmic says, it is indeed supported from version 4.5 up. EDIT: I have been studying this example, and it SHOULD work, but doesn't. I suspect that pin-1 is reserved for something else. It's been a while since I played with the Maximite series. What happens if you change your code so that pin-1 is NOT referenced? IE: Keypad KeyCode, KP_Int, 2, 3, 4, 5, 6, 7, 8 See the example in the 4.5 manual on page 12 - note that this example does not use pin-1..... It's a bit of a long-shot, but worth trying to see what happens. I will try to find the schematic for the Maximite, to find out if Pin-1 is special for some reason. EDIT: Found schematic. "Pin-1" on the box-header, is connected to pin-20 of the PIC32 chip itself, and that pin is just a standard I/O pin from what I can see in the datasheet for the PIC32, page 12. It is assigned as "Vbuson", so perhaps this pin is input only? It might be used for the USB sense perhaps. I'd be interested to know what happens if you use the example above that does not reference "Pin-1" on the box-header. Smoke makes things work. When the smoke gets out, it stops! |
||||
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1097 |
@BrianP For the Colour Maximite, the pin numbers in MMBasic are the I/O connector pins not actual device pins) so you usage should be OK but I would try the actual pins used in the 4.5C manual of 2,3,4,5,21,22,23 (21, 22, 23, being the D0, D1, D2 pins on the Arduino connector). Can you confirm you are using 4.5C? Which varient of the Colour Maximite? - the Australian one from Silicon Chip or the Circuit Gizmo's CMM or CMM2? I have both the latter and will be able to carry out tests but not till Monday sorry. Doug. Re I/O connector - not the actual connector pins but a series of numbers relating to MMBasic ie. connector pin 21 is I/O (MMBasic) pin 1, connector pin 19 is I/O pin 2 and so on - see the MMBasic Manual manual for 4.5 page 6. Sorry if I misled you above. D. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
The manual does state that any pins can be used but in the same sentence it goes on to say "but you must use pins 11 to 20 for C1 to C4". You are using pins 5, 6 and 7. Geoff Geoff Graham - http://geoffg.net |
||||
BrianP Senior Member Joined: 30/03/2017 Location: AustraliaPosts: 292 |
Thanks people for your responses. Geoff has nailed it, but in my defence my copy of the 4.5 manual nowhere mentions a restriction on the column pins assignment - see excerpt below... (Excerpt from 4.5 manual)... keypad. Note that these must be pulled up to 3.3V by individual 10K resistors (see the diagram below). c1, c2, c3 and c4 are the column connections. c4 is only used with 4x4 keypads and should be omitted if you are using a 4x3 keypad. Any I/O pins can be used and you do not have to set them up beforehand, the KEYPAD command will automatically do that for you. (followed by connection diagram - no mention of which pins). @Panky & Grogster - not sure what is meant by the reference to 4.5c. I have the latest version of the manual from Geoff's site & it is just v.4..5. My Maximite is the the Silicon Chip version from either Altronics or Jaycar - I can't remember which as it is now quite a while ago. Much fun to build & worked first go. I will be venturing into uMite land as soon as time permits - problem is, sooo many varieties / choices. Thanks again all who replied, very much appreciated. Regards to all Brian P. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
You are quite right and my apologies. Somehow the website has reverted to an old copy of the manual. Attached is the new version. 2017-04-29_032216_MMBasic_Language_Manual.pdf I will update my website when I can figure out what is going wrong. Geoff Geoff Graham - http://geoffg.net |
||||
BrianP Senior Member Joined: 30/03/2017 Location: AustraliaPosts: 292 |
Welcome to the world of computers... B |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
Yeah, my version of the MMBASIC manual for the colour Maximite is exactly the same as Brian's one, and makes no mention at all of pin restrictions. I have downloaded the new manual myself now! Smoke makes things work. When the smoke gets out, it stops! |
||||
Print this page |