Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 12:55 26 Apr 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 serial client code; MMB4W controller

     Page 2 of 2    
Author Message
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 12:08pm 23 Jun 2022
Copy link to clipboard 
Print this post

I get the spurious "1000" unless the temp is >30 deg(c). Never had anything other than that. No pullups.







Craig
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:43pm 23 Jun 2022
Copy link to clipboard 
Print this post

  Tinine said  I get the spurious "1000" unless the temp is >30 deg(c). Never had anything other than that. No pullups.


That should not be. All 10 of these DS18B20s are under 30C, and over the years I've recorded readings from various DS18B20 sensors from -12C to 37 (behind a barn door baked by the sun).

Not sure how you'd get any valid readings with no pullups anywhere.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 06:53am 24 Jun 2022
Copy link to clipboard 
Print this post

  lizby said  
  Tinine said  I get the spurious "1000" unless the temp is >30 deg(c). Never had anything other than that. No pullups.


That should not be. All 10 of these DS18B20s are under 30C, and over the years I've recorded readings from various DS18B20 sensors from -12C to 37 (behind a barn door baked by the sun).

Not sure how you'd get any valid readings with no pullups anywhere.


Oops, I lied. There is a pullup....exactly as shown in the manual  






Craig
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 03:26pm 25 Jun 2022
Copy link to clipboard 
Print this post

Here's a PicoMite client with a PicoMite server. What I'm calling the client is the same PicoMite with 10 DS18B20s as was previously connected via USB serial to the MMBasic for Windows program.



To connect to a PicoMite (or other 'mite) it had to be set up with OPTION SERIAL CONSOLE 1,2. Otherwise, it has just the MMBasic firmware--no user program.

Here's what the stack looks like:



Aside from the two Dupont wires crossed over connecting the Rx & Tx, I put long pin male headers on the upper Pico on VSys and the upper two and lower two 0V pins (for stability as well as to connect the grounds) to plug into female headers on the lower Pico.

What is displayed is a first pass at Paul_L's geothermal controller display with PC line drawing type graphics. Temperature readings from the 10 DS18B20s change every second.

Obviously the ILI9488 480x320 screen is not wide enough to display the full screen. (Didn't someone produce an SSD1963 PCB for the PicoMite?)

The code is attached. It should run unchanged on MMB4W (with serial properly wired), since I tried to discriminate between mm.device$="PicoMite" and mm.device$="MMBasic for Windows", but I haven't gone back and tried that yet.

G9.zip
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5725
Posted: 04:09pm 25 Jun 2022
Copy link to clipboard 
Print this post

I designed a SSD1963 adapter and a SSD1963 backpack with all sorts of stuff on it for the Pico a while ago, but although I half-heartedly built one up I never got it to work. I've just not go round to sorting it out yet. I really should. :)
Mick

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

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 12:18am 26 Jun 2022
Copy link to clipboard 
Print this post

I also did up a backpack for the Pico  here that caters for the SSD1963 LCDs as well as ILI9341/ILI9481. It includes and on-board connector for a micro SD card, an RTC as well as an ESP8266 (Wemos D1 mini). All other pins are brought out to connectors.

The only problem I had was a missing track to the ILI connectors - simple jumper wire fix. Happy to provide further details for anyone interested.

Doug.


PS. I have 2 spare bare boards for anyone in Australia/NZ which I can put in an envelope - PM me if interested. D.
Edited 2022-06-26 10:19 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:55am 26 Jun 2022
Copy link to clipboard 
Print this post

  panky said  I also did up a backpack for the Pico


Thanks, Doug. I actually found that I had noted your design on fruitoftheshed. I'd really like a board that is a little smaller (but no pressure, Mick).

This is just for playing for me, and I'd like to put the smallest 800x480 SSD1963 (5" I think) on it just to see how it looks. But I've got lots of other projects to pursue.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 03:17am 26 Jun 2022
Copy link to clipboard 
Print this post

  lizby said  
  panky said  I also did up a backpack for the Pico

... I'd like to put the smallest 800x480 SSD1963 (5" I think) on it just to see how it looks.

The PCB shown is exactly the same size as a 5" SSD1963 LCD.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:37pm 26 Jun 2022
Copy link to clipboard 
Print this post

  panky said  
  lizby said  
  panky said  I also did up a backpack for the Pico

... I'd like to put the smallest 800x480 SSD1963 (5" I think) on it just to see how it looks.

The PCB shown is exactly the same size as a 5" SSD1963 LCD.


Oh, looked bigger to me. I didn't see that the gerbers were posted. If you put them up (with the fix you found), I'll place an order. Thanks.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5725
Posted: 12:52pm 26 Jun 2022
Copy link to clipboard 
Print this post

My original designs for the SSD1963 boards got lost when a USB stick got corrupted, unfortunately. However, I had a thought last night about doing a pretty minimalist design, but intended strictly as a control system front-end. It uses the 5" 40-pin display because that's what I happen to have. :) The idea is to use it with the extended graphics, so no keyboard socket.

This one has full duplex RS-422 on a RJ45 socket (not using the ethernet wires) and an I2C port brought out to a header with GND and 3V3. The remaining 4 I/O are on a second header.

The advantage of full duplex is that you treat it as a straightforward COM port and MMBasic handles buffering etc. It also works nicely over CAT5.

Just not sure about using some of the cores for power. It might not be a good idea if someone was to plug ethernet stuff into it. Probably better to just power locally at  the other end. I've since added a link block to put 3V3 and GND on a pair.

The PicoMite uses it's SMPS to get the 3V3 for most of the stuff, but the SSD1963 has a linear regulator. The backlight is a pretty heavy load for the PicoMite.


Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 01:01pm 26 Jun 2022
Copy link to clipboard 
Print this post

  Quote  The PicoMite uses it's SMPS to get the 3V3 for most of the stuff, but the SSD1963 has a linear regulator. The backlight is a pretty heavy load for the PicoMite.


My experience was that the 4.3" SSD1963 would work off the PicoMite 3.3 supply
The 5" definitely won't work and needs a separate 3.3V supply
The 7" backlight is powered with 5V so as long as your PicoMite incoming supply is good then no additional 3.3V supply is needed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5725
Posted: 01:10pm 26 Jun 2022
Copy link to clipboard 
Print this post

Thanks, Peter. My horrible little USB meter didn't seem to be able to make its mind up, but it seemed to settle on about 250mA with the backlight full on, although at one point it was over 400mA. There was no PicoMite on the board so it wasn't that using the current. Mind you, I left all the caps off so the poor reg might have been oscillating. :).

I had the display working once, that's all. (One of the old design boards, not this one). It's a proof of concept though. :) Now to find the problem...
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 02:20pm 26 Jun 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  This one has full duplex RS-422 on a RJ45 socket (not using the ethernet wires) and an I2C port brought out to a header with GND and 3V3.


Looks good. Of course, I2C on--it looks like--GP4 and GP5 could also be UART1 serial Tx and Rx. Looking forward to seeing the gerbers. Might be good to provide for the possibility of vertical pullup resistors for the I2C.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 02:28pm 26 Jun 2022
Copy link to clipboard 
Print this post

  matherp said  The 5" definitely won't work and needs a separate 3.3V supply


But a 3V3 regulator powered from VBUS would work?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5725
Posted: 03:11pm 26 Jun 2022
Copy link to clipboard 
Print this post

Yes, providing that the USB port on your host can provide enough current!

VBUS is just the 5V supply direct from the USB socket. The PicoMite has no way to negotiate with the host to determine how much current it wants so it has to accept the default. Sometimes that is 100mA, even though the port is rated up to 500mA. Other devices simply use a 500mA polyfuse.

------------------------

They are GP20 & GP21, not GP4 and GP5 - they are already in use. :)
Pull-ups...  hmmm. Not a lot of space for those. Even the space under the PicoMite is very busy in this design. I don't stand resistors on end just on principal. :) It always reminds me of horrible transistor radios.

Yep, those pins could be COM2 TX and COM2 RX if you wanted them to be. I opted for I2C originally because I was sort of vaguely considering using them for a RTC and/or a Micromite I/O expander. Then I decided not to, and to put the RS-422 in instead.
Edited 2022-06-27 01:21 by Mixtel90
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 03:18pm 26 Jun 2022
Copy link to clipboard 
Print this post

@matherp
What code were you using for the CMM2 thread subject lines like, "200,000 Basic lines per second", "270,000 Basic lines per second"?

For MMBasic for Windows, I find the speeds vary, which is reasonable for a task within a multi-tasking system. For instance, for

> timer=0: for i=1 to 1000000: next: ?timer

I get variously (rounded to milliseconds): 1130, 1063, 1076, 1373, 1052. (I know the FOR NEXT isn't one line.)

What code would I use to get the results given for the CMM2 as various changes speeded it up?

(And of course, for a Windows program, it depends on which PC it is running on.)

ADDED: Was it sieve.bas, which for me gives 841,000 to 882,000 lines per second?

~
Edited 2022-06-27 01:29 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 03:29pm 26 Jun 2022
Copy link to clipboard 
Print this post

  Quote  I get variously (rounded to milliseconds): 1130, 1063, 1076, 1373, 1052. (I know the FOR NEXT isn't one line.)


This is the speedtest which Geoff has used from day 1. I get 270,000 on the PicoMite @ 378MHz.
Won't work on MMB4W of course but on your single line I get 55 so there is something amiss in your setup

' speed test
' will test and report the speed of MMBasic
'
Dim integer i,j, cnt
SetPin 1,dout : SetPin 5, din
lines = 5
loops = 1000000
Timer = 0
'
' start of the timed section (5 lines)
For i=1 To loops
j = Pin(5)
Pin(1) = j
Inc cnt
Next
'
Print "Speed is"; Int((cnt * lines)/(Timer /1000)); " lines per second."
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 03:46pm 26 Jun 2022
Copy link to clipboard 
Print this post

I'm not sure what is amiss. When I run it on the picomite (default CPU speed), I get 11100.244, so 11 seconds for one million iterations.

With OPTION CPUSPEED 378000 I get 3974.907, so about 4 seconds for one million iterations when running "timer=0: for i=1 to 1000000: next: ?timer".

One million iterations for MMBasic for Windows: varying, but around 1.1 seconds.

So my i7 laptop is only about 4 times faster than the overclocked PicoMite in running this code. Remarkable.

~
Edited 2022-06-27 08:01 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:05am 27 Jun 2022
Copy link to clipboard 
Print this post

Not sure if this is the right tread for this, but I won't be stepping on anybody's toes but my own, so here goes.

Paul_L's screen display with the PC drawing characters is working well with font 4, mode 1:



But Paul would like everything to be bigger. I set up all the TEXT commands to use a scale of 2, and that works with mode 16 (1920x1080, even though my laptop screen is actually only 1600x900:



There's one problem that I've found so far: if I write to TEXT 0,0,"SOMETHING",,,2 then the window banner overwrites the first lines of the text. For the image displayed above, I've fixed that by writing the first line at pixel row 6*mm.fontheight*scale.

As can be seen, this works ok (except that a bit of the top of the first line is still cut off), but is the need for this offset when TEXT is scaled something which should be looked at?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2024