October 10, 2024, 12:00:13 PM

Duinomite Mega

Started by BertP, June 16, 2015, 05:25:51 AM

Previous topic - Next topic

BertP

A strange effect when setting Pin(17) to a "1" using the program below.  The pin goes to 3.2V as soon as I press the 5 key.  It does not wait for the Enter key to be pressed.  Anyone know why?

SetPin 13,8
SetPin 14,8
SetPin 15,8
SetPin 16,8
SetPin 17,8
SetPin 18,8

Menu:
CLS
Print " 1) Set Pin13 to 1";tab(40);"11) Clear Pin13 to 0"
Print " 2) Set Pin14 to 1";tab(40);"12) Clear Pin14 to 0"
Print " 3) Set Pin15 to 1";tab(40);"13) Clear Pin15 to 0"
Print " 4) Set Pin16 to 1";tab(40);"14) Clear Pin16 to 0"
Print " 5) Set Pin17 to 1";tab(40);"15) Clear Pin17 to 0"
Print " 6) Set Pin18 to 1";tab(40);"16) Clear Pin18 to 0"

Input "Choice= ";Choice

If Choice=1 then Pin(13)=1
If Choice=2 then Pin(14)=1
If Choice=3 then Pin(15)=1
If Choice=4 then Pin(16)=1
If Choice=5 then Pin(17)=1
If Choice=6 then Pin(18)=1
If Choice=11 then Pin(13)=0
If Choice=12 then Pin(14)=0
If Choice=13 then Pin(15)=0
If Choice=14 then Pin(16)=0
If Choice=15 then Pin(17)=0
If Choice=16 then Pin(18)=0

goto Menu

end

KeesZagers

Hello BertP,

I don't have a real explanation or solution for your problem, only a suggestion:

You did not mention the version of the MMBasic you are working on, but I suggest it is a recent one. My experience is: better use the old OPEN DMBasic 2.7 (download on GITHUB; link of Olimex). In this version I found at least 4 principal bugs in the software, which I could repair in my own firmware, because it was still open. I could fix this with a non-registered version of MPLAB-X and the C32 compiler.

Since the new versions are not open anymore and the Duinomite MEGA seems not to be the most favorite platform for Geoff (understatement), I believe the number of bugs has grown and you cannot fix them yourself anymore.

To convert your program to DMBasic 2.7 you just have to add line numbers to your program, delete the line "Menu:" and change the word "Menu" in the Goto statment to the lineno of the "CLS" line.

Kees

JohnS

Or you might ask GeoffG for the current source, compare, find & fix the bug.  But it's not the easiest thing to do and then you still have a closed source version.  You could hope Geoff will add the fix if you send him it.

I'm not sure what the problem is, but the above applies to any bug in the newer version...

John

ctigs

#3
This is because pin 17 and pin 18 are used for the PS/2 keyboard.  Port D 6 & 7.


**UPDATE** I thought the desighation D6 & D7 were port references.  They aren't.   This is actually connected to port E on the pic.

let me try this on my mega tonight and see if mine does it too.

ctigs

I'm not sure what I can say about this, but like the other responder said you did not specify which basic you are using.  I know it's one of the newer ones from Geoff.

I tested this with Geoff's DMbasic 4.5 on both my DuinoMite and my DuinoMite-mega and it worked perfectly.

I wasn't using a meter or scope, maybe you are?  I used an LED bargraph and was able to turn on and off all of the individual led's properly, no strange interactions between numbers and enter.

You also didn't mention how you are powering the board, if you are using keyboard/monitor or virtual com to run the program.

But this works fine on 2 versions of the board with 4.5