Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:38 29 Nov 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 : PicoMite/PicoMiteVGA/WebMite V5.07.07 release candidates

     Page 10 of 13    
Author Message
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 03:11am 29 Apr 2023
Copy link to clipboard 
Print this post

Thanks @phil99, I must have been reading incorrect information.  Maybe it was related to different hardware.  Like I said, I was Googling, looking for the answers.

I'll update the table and see what it looks like.

Mmm...unfortunately it just darked all the blended colours, reducing the dynamic range of the palette.

Are the values you've given based on the resistor values in the Green circuit of the VGA?  ie. bit values 10 is twice the voltage of bit values 01.

 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1115
Posted: 03:23am 29 Apr 2023
Copy link to clipboard 
Print this post

  Hawk said  

I've been playing with creation of graphics for the PicoMiteVGA.

Can I also suggest that an updated version of the manual include the colour palette mapped to the RGB values, the names, and the numbers (if that bug/feature) has been changed?

Also, I have seen conflicting information in the existing manual regarding the number of sprites supported.  Is it 32 or 64?

Thanks,
Mike

Mike
The Order of the Colornubers, as also used in Sprite Files, are

0=BLACK
1=BLUE
2=GREEN
3=CYAN
4=RED
5=MAGENTA
6=YELLOW
7=WHITE
8=MYRTLE
9=COBALT
A=MIDGREEN
B=CERULEAN
C=RUST
D=FUCHSIA
E=BROWN
F=LILAC



Dim Col%(15),f%
Restore colors:For f%=1 To 15:Read Col%(f%):Next f%

colors:
'--Colorscheme accordung to matherp
Data RGB(BLUE),RGB(GREEN),RGB(CYAN),RGB(RED)
Data RGB(MAGENTA),RGB(YELLOW),RGB(WHITE),RGB(MYRTLE)
Data RGB(COBALT) ,RGB(MIDGREEN),RGB(CERULEAN),RGB(RUST)
Data RGB(FUCHSIA),RGB(BROWN),RGB(LILAC)



Edited 2023-04-29 13:57 by Martin H.
'no comment
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 04:10am 29 Apr 2023
Copy link to clipboard 
Print this post

  Hawk said  Are the values you've given based on the resistor values in the Green circuit of the VGA?  ie. bit values 10 is twice the voltage of bit values 01.

For green the two most significant bits of the byte become Green High and Green Low.
For red and blue just the MSB is used.
For the VGA that program just reads back values from the frame buffer. The resistors determine what actually goes to the screen. Put a 1k trim-pot plus 220R in series with each of 4 pins and you can have whatever you like.
Four bits just isn't enough to be too fussy about precision. No matter what 16 you choose all colours in between those will be wrong, and that is the great majority of colours.

Edit
Perception of colour brightness isn't linear. Like most senses it is approximately logarithmic, for a uniform colour covering the entire visual field. Edges with a contrast in colour and brightness change what we see, especially if we perceive that edge to be a shadow. And no two people see quite the same thing. Remember the controversy over the colour of a dress? People seeing completely different colours in the same photo.
Edited 2023-04-29 14:28 by phil99
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 04:20am 29 Apr 2023
Copy link to clipboard 
Print this post

OK, I've updated according to Martin's info.  I can't go against the facts, but I do like the palette I posted that has the shades of the same colours all together.  I can see the patterns in the numbers of the correct palette so I guess there's a programmatic reason for it.

So when you create an indexed bitmap to use in a program, the palette needs to be like this?   I'll need to update my palette in the GIMP.


Sorry...this has really corrupted the original topic.  I didn't intend this to get so far off topic.  Perhaps it needs moving to it's own thread.
Edited 2023-04-29 14:34 by Hawk
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 05:37am 29 Apr 2023
Copy link to clipboard 
Print this post

@phill,

The green levels look like 0,1/3, 2/3, 1
Not 1/4 and 1/2.

Correct me if I am wrong...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 06:11am 29 Apr 2023
Copy link to clipboard 
Print this post

  Volhout said  @phill,

The green levels look like 0,1/3, 2/3, 1
Not 1/4 and 1/2.

Correct me if I am wrong...

Volhout


Ah...I think you are where I got the information from, and it made sense to me at the time.

00 = Black
01 = ?
10 = ?
11 = Bright Green

b10 is twice as bright (twice the voltage) as b01.
b11 is not twice as bright as b10.  It's only b01 brighter.

I cut out the section of this post relating to the resistor values, as I found that the VGA portion of the circuit in the manual for the Silicon Chip kit is different from the VGA portion of Ver 5.07.06.

The Silicon Chip circuit gets the correct ratios by using all the same resistor values, but using some in series and some in parallel, thus maintaining the correct ratio for each bit.
Edited 2023-04-29 16:37 by Hawk
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6812
Posted: 07:05am 29 Apr 2023
Copy link to clipboard 
Print this post

The PicoMite's / MMBasic's VGA system is fun. :)

Only the resistor values affect what you see. The PicoMite doesn't care what you see, it just outputs a 4-bit binary number on the video pins. The colour names in MMBasic are only relative to the values that were used with the original VGA circuit.

There is no "palette" in the conventional sense. You can't choose the colours, you are stuck with a 4-bit binary number and you can call the values anything you like. e.g. MYPINK = RGB(0,64,0) and what you see will depend on what you dd with the resistors. :)

Normally you have 1 bit for red, 1 bit for blue and 2 bits for green. You can work out the VGA input voltages:
For red and blue 270R into 75R will give about 664mV
For dark green 820R into 75R will give about 250mV
For green 390R into 75R will give about 484mV
For light green 264R (820R//390R) into 75R will give about 660mV

As it's a binary output the greens should ideally have a 2:1 relationship that gives 650mV for light green. It's very unlikely that you'd spot the difference though. If you want to experiment change the 390R to 410R - but it's non-standard so use two 820R in parallel. That gives 460mV for green and 645mV for light green if I've done my sums correctly ...
.
Edited 2023-04-29 17:19 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 07:41am 29 Apr 2023
Copy link to clipboard 
Print this post

Add the output impedance of the pico, 30 to 50 ohm.
Also take into account that when 820 pulls up, and 390 pulls down, rhe divider is 820 onto (390 parallel 75).

Volhout

That is all theoretical, fact is that there are 16 fixed colors. The pallette can be used to dither any picture to these 16 colors. With more or less quality loss.
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6812
Posted: 07:44am 29 Apr 2023
Copy link to clipboard 
Print this post

Well spotted - I'd forgotten those points. :)  Too early in the day for me yet. Need coffee..................
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 08:31am 29 Apr 2023
Copy link to clipboard 
Print this post

Thanks for the explanation gentlemen.  So the upshot is, the actual colours that are displayed will be different for each version of the VGA output circuit.  There is no standard.  So what might look good on one machine may look very different on another.

Any palette that we define in a paint program to use to create graphics for the PicoMiteVGA will be just an approximation of the final output from the device.

At least now I have that palette to work with, and based on my experiments on my device, it's a pretty good approximation, so thanks again.  

I'm finding working without a grey value challenging, but it's the limitations that bring out creativity, right?  Was RGBI ever considered as a viable option for the PicoMiteVGA?

For those that use the GIMP, here is the palette.

PicoMiteVGA.gpl.zip
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 08:45am 29 Apr 2023
Copy link to clipboard 
Print this post

  Quote  Put a 1k trim-pot plus 220R in series with each of 4 pins and you can have whatever you like.


Early on in the PicoVGA development there was talk of having 4 bit RGB+Intensity. I experimented with that using a custom output circuit that used the green low pin to modulate the other 3. As the firmware is RGB(1,2,1) I used IrfanView to modify all the colours of images so they would decode correctly on the VGA (looked awful on the computer screen). It worked ok but 4 bits is 4 bits and no matter how you carve, slice or dice it pictures are poor. 320 x 240 on a big screen doesn't help either.

It is great for graphics where exact colours don't matter.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:18am 29 Apr 2023
Copy link to clipboard 
Print this post

V5.07.07RC8 last before release?

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Various bug fixes as per Tom's tests
New command
SYNC time% [,period]

SYNC

The  SYNC command allows the user to implement very precisely timed repeated actions (1-2 microseconds accuracy). To enable this the command is first called with the parameter time%. This sets up a
repeating clock for time% microseconds. The optional parameter ‘period’ modifies the time and can be can be “U” for microseconds, “M” for milliseconds or “S” for seconds. Once the clock is set up the program
is synchronised to it using the SYNC command without parameters. This waits for the clock period to expire. For periods below 2milliseconds this is non-interruptible. Above two milliseconds the program will respond to Ctrl-C but not
any MMBasic interrupts. Typical use is to set the clock outside of a loop and then at the top of the loop call the SYNC command without parameters. This means the contents of the loop will
be executed exactly once for each clock period set. For example:  SYNC 20, M:  DO:  SYNC:  PULSE GP0,n:  LOOP would drive a servo with the required precise 50Hz timing

Also new option on SPRITE SHOW and SPRITE SHOW SAFE. To allow BLACK to be displayed set bit 2 in the option/orientation parameter e.g.

MODE 2
Box 0,0,30,30,4,RGB(red)
Sprite read 1,0,0,30,30
CLS RGB(blue)
Do
Sprite show 1,60,60,1
Pause 1000
Sprite show 1,90,90,1,4
Pause 1000
Loop
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:48am 29 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  V5.07.07RC8 last before release?


Sorry Peter, neither of us gets off that easily:

Option Explicit On
Option Default None
Option Base 0

? Call("int_fn%")

Function int_fn%()
 int_fn% = 42
End Function


PicoMite:
42


PicoMiteVGA:
[5] Print Call("int_fn%")
Error : Unknown user function


Also do you care that some of the error message surrounding invalid fun/sub calls are different on the PicoMite and PicoMiteVGA, presumably because of their different generation lookup algorithms ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6812
Posted: 10:55am 29 Apr 2023
Copy link to clipboard 
Print this post

Who'd have thought you could get all this stuff on a RP2040? Congratulations, Peter! Nice work again - and it'll keep the servo users very happy, I think. :)  I can see it being useful for stuff like PLCs too, which often use a fixed program cycle.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 11:54am 29 Apr 2023
Copy link to clipboard 
Print this post

Hello Peter,

great work!

  matherp said  V5.07.07RC8 last before release?


No


> option list
PicoMiteWEB MMBasic version 5.07.07RC8
OPTION COLOURCODE ON
OPTION HEARTBEAT OFF
OPTION WIFI ***, *****************
OPTION TCP SERVER PORT 80
OPTION TELNET CONSOLE ON


I have tested OPTION PIN once at WEBMITE and so far the protection and access also works via TELNET.
After entering the pin, it is displayed again in the command prompt. I can live with that.

But how do I reactivate the protection after I was once on the WEBMITE via TELNET? The PIN is no longer requested for the second access.
In the course of this, I noticed that the OPTION AUTORUN returns an "Error : Syntax". This means that the autostart does not work and the WATCHDOG is also pointless. A reset does not help me either.

Addendum:
what about the LED on the WEBMITE ? Can it now be controlled directly?
The command OPTION HEARTBEAT ON / OFF works. Fun fact: Depending on whether the LED is currently on or off, it remains in this state with the OFF command.

Matthias
Edited 2023-04-29 22:02 by homa
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 12:10pm 29 Apr 2023
Copy link to clipboard 
Print this post

A work-around for OPTION AUTORUN might be:-

Sub MM.Startup
  RUN
End Sub

Placed in the Library.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 12:12pm 29 Apr 2023
Copy link to clipboard 
Print this post

  Quote  I noticed that the OPTION AUTORUN returns an "Error : Syntax".


That's because it is a syntax error
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 12:17pm 29 Apr 2023
Copy link to clipboard 
Print this post

Ah!
OPTION AUTORUN ON

OPTION AUTORUN n
Specifying ‘n’ will cause that location in flash memory to be run.
‘n’ must be in the range 1 to 7

Will need adjusting in the next manual
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 12:45pm 29 Apr 2023
Copy link to clipboard 
Print this post

ok my mistake.
it's also on page 76 of the manual ...

If the programme is running, the PIN is also asked for when reconnecting!

AND   YES

@peter: And what about the LED?
Edited 2023-04-29 22:49 by homa
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 12:58pm 29 Apr 2023
Copy link to clipboard 
Print this post

But a mini note: If the web server is running on the WEBMITE and this is PIN protected. Then use Tera Term on the WEBMITE, now Ctrl-C. Do not answer the PIN query and simply close Tera Term and the web server no longer works. Is there any way to cancel the PIN request and continue running the programme (except deliberately 0 to restart)? Or even the programme continues to run until Ctrl-C is confirmed by the correct PIN?
 
     Page 10 of 13    
Print this page
© JAQ Software 2024