Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:37 19 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 : MM+ GUI Page 3 issue?

Author Message
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 01:38am 04 Jun 2017
Copy link to clipboard 
Print this post

Howdy all,

Second time I've come across this fault since updating to 5.04.04.

Whenever I GUI SETUP 3 and then call it with PAGE 3, I get the following error:-

  Quote  > run
[56] Page 3,9
Error: Invalid font number #8
>


Last time I struck this with a different code it complained about font #16 being invalid.
I'm not using those fonts. I'm only using font #1. Interestingly, If I change the two PAGE references from '3' to '4', the code works fine.
Code below for testing purposes.....



option default integer
base = 1

'Page 3 GUI Elements

const Page3label_CH = 54
const Page3label_MaxAmps = 55
const Page3label_TripAmps = 56
const Page3label_Status = 57
const Page3label_Ch1 = 58
const Page3label_Ch2 = 59
const Page3label_Ch3 = 60
const Page3label_Ch4 = 61
const Page3MaxAmps_Ch1 = 62
const Page3MaxAmps_Ch2 = 63
const Page3MaxAmps_Ch3 = 64
const Page3MaxAmps_Ch4 = 65
const Page3TripAmps_Ch1 = 66
const Page3TripAmps_Ch2 = 67
const Page3TripAmps_Ch3 = 68
const Page3TripAmps_Ch4 = 69
const Page3Status_Ch1 = 70
const Page3Status_Ch2 = 71
const Page3Status_Ch3 = 72
const Page3Status_Ch4 = 73
const Page3Frame = 74

'Tab Elements
const Tab1 = 91
const Tab2 = 92
const Tab3 = 93
const Tab4 = 94

'Misc Variables
const Ok = 1
const Trip = 2
const Fail = 3
Dim as Float TripAmps(4), MaxAmps(4)

'------------------------------------------------------------------

'Main Program for testing

CLS
pwm 2, 500, 50 'Set backlight to on (MM+ LCD Backpack
font 1, 1 'Set font to #1, scale 1.

for I = 1 to 4
TripAmps(I) = 1.25 'Test figures for display
MaxAmps(I) = 1.43
next I

GuiSetup 'Setup Pages
page 3,9
gui show all

do
for I = 1 to 4
ChangeStatus(Page3Status_ch1,I)
ChangeStatus(Page3Status_ch2,I)
ChangeStatus(Page3Status_ch3,I)
ChangeStatus(Page3Status_ch4,I)
pause 500
next I
loop

'------------------------------------------------------------------

Sub ChangeStatus(Element,State)

select case State
Case Ok
gui fcolour rgb(green),Element
gui bcolour rgb(black),Element
ctrlval(Element) = "OK"
Case Trip
gui fcolour rgb(yellow),Element
gui bcolour rgb(red),Element
ctrlval(Element) = "TRIP"
case Fail
gui fcolour rgb(Black),Element
gui bcolour rgb(red),Element
ctrlval(Element) = "FAIL"
Case else
gui fcolour rgb(red),Element
gui bcolour rgb(black),Element
ctrlval(Element) = "????"
end select
end sub

'------------------------------------------------------------------

sub GuiSetup

'Tab Buttons

GUI SETUP 9
GUI Switch Tab1, "Main", 0, 0, 78, 30, RGB(white), RGB(Gray)
GUI Switch Tab2, "Relays", 80, 0, 78, 30, RGB(White)
GUI Switch Tab3, "Current", 160, 0, 78, 30, RGB(White)
GUI Switch Tab4, "Config", 240, 0, 78, 30, RGB(White)
CtrlVal(Tab1) = 0
CtrlVal(Tab2) = 1
CtrlVal(Tab3) = 1
CtrlVal(Tab4) = 1

'Page 3

GUI SETUP 3

Gui frame Page3Frame,"Current (Amps) Page",0,45,320,193,rgb(white)
gui caption Page3label_CH, "CH.", 10,60,,rgb(cyan)
gui caption Page3label_TripAmps, "Trip Amps", 68,60,,rgb(cyan)
gui caption Page3label_MaxAmps, "Max Amps", 159,60,,rgb(cyan)
gui caption Page3label_Status, "Status", 250,60,,rgb(cyan)
gui caption Page3label_Ch1, "1", 18,93,,rgb(cyan)
gui caption Page3label_Ch2, "2", 18,131,,rgb(cyan)
gui caption Page3label_Ch3, "3", 18,169,,rgb(cyan)
gui caption Page3label_Ch4, "4", 18,207,,rgb(cyan)

gui caption Page3TripAmps_Ch1,str$(TripAmps(1),2,2)+"A",76,93,,rgb(white)
gui caption Page3TripAmps_Ch2,str$(TripAmps(2),2,2)+"A",76,131,,rgb(white)
gui caption Page3TripAmps_Ch3,str$(TripAmps(3),2,2)+"A",76,169,,rgb(white)
gui caption Page3TripAmps_Ch4,str$(TripAmps(4),2,2)+"A",76,207,,rgb(white)

gui caption Page3MaxAmps_Ch1,str$(MaxAmps(1),2,2)+"A",163,93,,rgb(white)
gui caption Page3MaxAmps_Ch2,str$(MaxAmps(2),2,2)+"A",163,131,,rgb(white)
gui caption Page3MaxAmps_Ch3,str$(MaxAmps(3),2,2)+"A",163,169,,rgb(white)
gui caption Page3MaxAmps_Ch4,str$(MaxAmps(4),2,2)+"A",163,207,,rgb(white)

gui displaybox Page3Status_Ch1,250,87,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch2,250,125,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch3,250,163,45,25,rgb(green),rgb(black)
gui displaybox Page3Status_Ch4,250,201,45,25,rgb(green),rgb(black)

ctrlval(Page3Status_Ch1) = "OK"
ctrlval(Page3Status_Ch2) = "OK"
ctrlval(Page3Status_Ch3) = "OK"
ctrlval(Page3Status_Ch4) = "OK"
end sub


I'm using a Silicon Chip MM+ LCD Backpack.

Bug?

Cheers!
GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 02:25am 04 Jun 2017
Copy link to clipboard 
Print this post

I have just run your test program and it works fine. It might be something else (not PAGE 3) but I cannot think what.

Can you simplify the code and still make it fall over?

Geoff
Geoff Graham - http://geoffg.net
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 02:37am 04 Jun 2017
Copy link to clipboard 
Print this post

Simplified to below and it still does it.....


GuiSetup
page 3

sub GuiSetup
GUI SETUP 3
end sub


  Quote  > run
[3] Page 3
Error: Invalid font number #8
>
option list
OPTION LCDPANEL ILI9341, LANDSCAPE, 2, 23, 29
OPTION TOUCH 1, 3
OPTION CONTROLS 130



I'll try reflashing the chip.....
...... Don't worry mate, it'll be GoodToGo!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 02:54am 04 Jun 2017
Copy link to clipboard 
Print this post

Reflashed and now I get Invalid font #16???

I'll try reflashing 5.03......
...... Don't worry mate, it'll be GoodToGo!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 03:05am 04 Jun 2017
Copy link to clipboard 
Print this post

OK,
Reflashed back to 5.03.02, and it works as advertised.
Reflashed to 5.04.04 and again, it works as advertised.

I can't explain that one.....

Thanks for your again Geoff.

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9083
Posted: 06:58pm 04 Jun 2017
Copy link to clipboard 
Print this post

Bizarre.

Perhaps it was just one of those odd things that you clear by reflashing the chip.

Smoke makes things work. When the smoke gets out, it stops!
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 03:41am 05 Jun 2017
Copy link to clipboard 
Print this post

@Grogster, I was hoping so but today the thing flagged Invalid Font #16 for Page 4......
I hit the reset button, and then it worked fine. I'm starting to wonder if the chip is flaky....

It's gonna be a bastard to desolder and replace..... Might have to get some ChipQuik....

Cheers,

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9083
Posted: 10:46pm 05 Jun 2017
Copy link to clipboard 
Print this post

Possible. Probably not THAT likely though. Out of the hundreds of chips I have used thus far, I can't say I have even had ONE faulty one. Not counting situations where I killed or otherwise damaged it.

ChipQuik makes unsoldering QFP's a breeze. If in any doubt, I can remove and replace it for you. PM me if you want to go down that path.

I have a system that uses 21 pages of GUI controls, and this code does not fall over with that message ever, either on the old or new versions of MMBASIC, so it is very strange indeed.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:50pm 05 Jun 2017
Copy link to clipboard 
Print this post

Check your power supply.
Weird things can happen when the power is not stable or noisy.

Microblocks. Build with logic.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 12:18am 06 Jun 2017
Copy link to clipboard 
Print this post

also check Vcap carefully. i'd be inclined to replace it before the processor.


cheers,
rob :-)
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 04:56am 06 Jun 2017
Copy link to clipboard 
Print this post

  MicroBlocks said   Check your power supply.
Weird things can happen when the power is not stable or noisy.


Powered from usb off a computer......

  robert.rozee said   also check Vcap carefully. i'd be inclined to replace it before the processor.


Hmmm.... There's not a bad idea. I should have another SMD cap kicking around somewhere....

The bastard did it again today on Page 3. In the end I just renamed Page 3 to Page 5.
Been alright since.

Cheers,

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 10:45am 06 Jun 2017
Copy link to clipboard 
Print this post

  GoodToGo! said  
  MicroBlocks said   Check your power supply.
Weird things can happen when the power is not stable or noisy.


Powered from usb off a computer......



Torn a few hairs out in that respect.
My E100's power fine off the USB ports on either of my laptops;
Wander to the office with it & plug it into the desktop (Gigabyte M/B) & things aren't so happy.

Seems that the current is limited on the ports.

Phil.

 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 11:11am 06 Jun 2017
Copy link to clipboard 
Print this post

  Phil23 said  
Seems that the current is limited on the ports.

Phil.


Phil
USB sockets coloured white and black are usually limited to a maximum of 500mA and can sometimes be much less. USB sockets coloured blue (USB 3) are usually able to supply much more current. If you have a choice use the blue sockets. Cables with blue plugs and sockets are also better at getting that current to your device with a minimum of voltage drop. The important thing is voltage at the board.
Bob
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 02:11pm 06 Jun 2017
Copy link to clipboard 
Print this post

I have found that USB ports and USB battery chargers are a poor power supply for Micromite projects. They often have significant noise (sometimes as much as 0.5V p-p) and the voltage can drop below 4.5V.

This could easily be the source of the PAGE 3 issue.

Geoff
Geoff Graham - http://geoffg.net
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 08:22pm 06 Jun 2017
Copy link to clipboard 
Print this post

Ok.

Vcap replaced, no joy. (Old Vcap measured 10uf)
Powered MM+ LCD backpack using a 0-30v 0-1a Lab regulated power supply. No Joy.

What I don't understand is that if I change all references from Page 3 to Page 5 then the code works perfectly.

Got me stuffed.....

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Print this page


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

© JAQ Software 2024