Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:20 02 May 2025 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 : Pi-cromite: V5.05.01

     Page 3 of 4    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 03:42am 07 Dec 2018
Copy link to clipboard 
Print this post

Is there an example program available for testing graphics on HDMI on the pi-cromite?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 11:11am 07 Dec 2018
Copy link to clipboard 
Print this post

Thanks Peter that helped a lot

I do have a couple of other questions

I've had Picromite running for several days displaying a clock on the SSD1963

Today the clock was 10 minutes slow.

Could you tell me the following please?

1. How often does the Picromite software update TIME$ from the Pi
2. Is it possible to manually tell it to update the time if the length is too long or the time wrong?
3. Is the RTC code included in Picromite if the option pin is enabled?
4. Is it possible to call the NTP time driectly from MM on a Pi Zero W rather than using the Pi clock?
5. Does anyone know how often Raspberrian updates the clock from the NTP server and is it possible to get it to do it more often? - I've looked on all the help on Raspbian I can find and all I can find is how to enable NTP and update the NTP server but nothing on how often it calls the time or changing the time period

Ideally if it was possible without "too much" of a problem to call the NTP server direct from the MM code and update TIME$ with that so the clock is exact and not relying on what Raspbian might be doing.

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10001
Posted: 11:24am 07 Dec 2018
Copy link to clipboard 
Print this post

  Quote  1. How often does the Picromite software update TIME$ from the Pi
2. Is it possible to manually tell it to update the time if the length is too long or the time wrong?
3. Is the RTC code included in Picromite if the option pin is enabled?
4. Is it possible to call the NTP time driectly from MM on a Pi Zero W rather than using the Pi clock?
5. Does anyone know how often Raspberrian updates the clock from the NTP server and is it possible to get it to do it more often? - I've looked on all the help on Raspbian I can find and all I can find is how to enable NTP and update the NTP server but nothing on how often it calls the time or changing the time period


1. It always uses the Pi time
2. N/A
3. No but you could use normal I2C to interrogate an external RTC
4. N/A it uses Pi time
5. Don't know

  Quote  Ideally if it was possible without "too much" of a problem to call the NTP server direct from the MM code


Should be trivial - just execute the NTP command using the MMBasic SYSTEM command, something like :


SYSTEM "sudo service ntp stop"
SYSTEM "sudo ntpdate uk.pool.ntp.org"
SYSTEM "sudo service ntp start"


You may need to install ntpdate

sudo apt-get install ntpdate


Edited by matherp 2018-12-08
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 12:25pm 07 Dec 2018
Copy link to clipboard 
Print this post

Thanks Peter
That really helped a lot - I've now got the Pi synced to proper UK NTP and it polls it appx every 512 seconds

Can I just clarify one thing please

Every time I call the time on the MM it pulls the time direct from the Pi?

so if I do
PRINT TIME$ it actually gets the time direct from the Pi and not from the MM software?

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10001
Posted: 12:40pm 07 Dec 2018
Copy link to clipboard 
Print this post

  Quote  Every time I call the time on the MM it pulls the time direct from the Pi?

Yes
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 07:54pm 07 Dec 2018
Copy link to clipboard 
Print this post

  lizby said  Is there an example program available for testing graphics on HDMI on the pi-cromite?


After R-ing TFM, I realized how straightforward it was. Some fiddling later, my first mmbasic graphic screen (not GUI).



Here's the code.
[code]
const indigo=&H4b0082
const lavender=&He6e6fa
const lemonchiffon=&Hfffacd
const gold=&HFFD700
dim as integer i,j
j=mm.vres/12 ' row height for 12 rows
cls
box 0,0,mm.hres,mm.vres,,,rgb(black) ' box around circumference
text mm.hres/2,4,"Some Header",c,,4,indigo ' header
text mm.hres/2, j+4, date$+" "+time$, c,,4
text mm.hres/2, j*2+4, "SETTING #1", c,,4,rgb(black),gold
rbox 10,2*j,mm.hres/8+10,j-3,,,rgb(green)
text 25,2*j+6,"POWER1",,,3,rgb(black),rgb(green)
rbox mm.hres/8*6.5,2*j,mm.hres/8+10,j-3,,,rgb(red)
text mm.hres/8*6.5+10,2*j+6,"POWER2",,,3,rgb(black),rgb(red)

text mm.hres/8/2+5, 3*j+5, "Relays", c,,3
text mm.hres/8*4.5, 3*j+5, "Measurements", c,,3
for i=1 to 8 : rbox 10,(i+3)*(j),mm.hres/8-1,j-3,,,rgb(red) : next i
for i=1 to 7 : rbox mm.hres/8+50,(i+3)*j,mm.hres/8*3,j-3,,,lemonchiffon : next i
for i=1 to 5 : rbox mm.hres/8*4+110,(i+3)*j,mm.hres/8*3,j-3,,,lemonchiffon : next i
for i=1 to 2 : box mm.hres/8*4+110,(i+9)*j,mm.hres/8*3,j-3,,,lavender : next i
text mm.hres/8*6, 9*j, "Readings", c,,3
for i=1 to 8 : text 25,(i+3)*j+6,"relay"+str$(i),,,2,rgb(black),rgb(red) : next i
for i=1 to 7 : text mm.hres/8*3/2+mm.hres/8+50,(i+3)*j+6,"measurement"+str$(i),c,,2,rgb(black),lemonchiffon : next i

for i=1 to 5 : text mm.hres/8*6,(i+3)*j+6,"measurement"+str$(i+7),c,,2,rgb(black),lemonchiffon : next i

for i=1 to 2 : text mm.hres/8*6,(i+9)*j+6,"readings"+str$(i),c,,2,rgb(black),lavender : next i

rbox 10,(7)*(j),mm.hres/8-1,j-3,,,rgb(green)
text 25,(7)*j+6,"relay4",,,2,rgb(black),rgb(green)
rbox 10,(9)*(j),mm.hres/8-1,j-3,,,rgb(green)
text 25,(9)*j+6,"relay6",,,2,rgb(black),rgb(green)
[/code]
Color rendition of the screen shot is not very good. It's actually much brighter.

This is the hdmi monitor: https://www.amazon.com/gp/product/B01GC9WTGK
Edited by lizby 2018-12-09
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 10:36pm 07 Dec 2018
Copy link to clipboard 
Print this post

One observation and two questions.

To get the flashing cursor to stay off in Lite after a reboot, I had to put these lines in /etc/rc.local

sudo su
setterm -cursor off > /dev/tty1

Question 1: is there a way to keep the text produced when booting from displaying on the hdmi monitor? (I'm running headless on a Zero-W and connecting with wifi.)

Question 2: is there a way to paste text in at the mmbasic ">" prompt? (I would find this very useful.)


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 965
Posted: 11:05pm 07 Dec 2018
Copy link to clipboard 
Print this post

  lizby said  
Question 2: is there a way to paste text in at the mmbasic ">" prompt?


Using Putty on windows, SHIFT + Insert will paste for me.
(The real Shift key, not the one on the keypad.)


Latest F4 Latest H7 FotS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 11:25pm 07 Dec 2018
Copy link to clipboard 
Print this post

Thank you--SHIFT+Insert does it for me. I have been used to using the right mouse button, and that doesn't work with the pi-cromite settings.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 04:01pm 08 Dec 2018
Copy link to clipboard 
Print this post

Any chance of getting something like this 7" touch hdmi monitor to work (touch that is) with the pi-cromite, especially pi Zero W? LCD GUI and touch with no GPIO pins used would be fabulous on a very small, very fast $10 board.

7" touch hdmi monitor for Raspberry Pi

I know that touch with this monitor involves use of the OTG USB connection, but maybe there is some linux system magic that would work.
Edited by lizby 2018-12-10
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 10:14pm 08 Dec 2018
Copy link to clipboard 
Print this post

Can we get the DAY$ function on the pi-cromite?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10001
Posted: 10:32am 09 Dec 2018
Copy link to clipboard 
Print this post

  Quote  Can we get the DAY$ function on the pi-cromite?


Why not - I've also included EPOCH and DATETIME$. NB I've changed DAY$ so that you can use it to find the day of the week of any date. EPOCH and DATETIME$ work back to 1902 with epoch going negative before 1970.

2018-12-09_231440_mmbasic.zip

2018-12-09_203925_Pi-cromite_Manual.pdf






  Quote  Any chance of getting something like this 7" touch hdmi monitor to work (touch that is) with the pi-cromite


Haven't got one and too expensive to buy just to play with - sorry
Edited by matherp 2018-12-10
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 03:52pm 09 Dec 2018
Copy link to clipboard 
Print this post

Thanks for the (enhanced) DAY$ function.

  matherp said  
  Quote  Any chance of getting something like this 7" touch hdmi monitor to work (touch that is) with the pi-cromite


Haven't got one and too expensive to buy just to play with - sorry

If you would be willing to donate your valuable time, I would be more than happy to donate the equipment. Please PM me with an address to send it to if you are willing. I think an r-pi gui touch screen that needs no backpack would be a very useful addition to the mmbasic family.
Edited by lizby 2018-12-11
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 07:09pm 09 Dec 2018
Copy link to clipboard 
Print this post

In the pi-cromite manual, pins 27 & 28 are labelled ID_SD and ID_SC. I couldn't see any other mention of those labels in the manual. They appear not to be available for digital i/o. What are they for?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 263
Posted: 06:26pm 10 Dec 2018
Copy link to clipboard 
Print this post

I recently added a DS3231 real time clock (RTC) to one of my Raspberry Pi computers.

Here are the two commands that I use for communicating with the RTC;

sudo hwclock -r reads the RTC

sudo hwclock -s writes the RTC info to the system time

The DS3231 I'm using is an I2C device and required the following statements to configure;

dtparam=i2c_arm=on

dtoverlay=i2c-rtc,ds3231

Here's a pic of the RTC mounted on a GPIO expansion card along with a SenseHat.


 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3299
Posted: 02:27pm 18 Dec 2018
Copy link to clipboard 
Print this post

Regarding pins 27 & 28, labelled ID_SD and ID_SC, Mr. Google tells me that on the Pi 3 they are reserved for an I2C channel which interrogates an ID eeprom which can provide information so that the PI3 can auto-configure hats (which have such an eeprom)--but otherwise and on other Pi models, these pins can be used for digital i/o.

I'm looking at a design for the pi zero w which is pushing the number of pins available (12 DS18B20s, 8 relays, 2 flow sensors, 4 digital inputs, hdmi LCD). I'd like to have I2C on pins 3 & 5, and would like a spare or two. Would it be convenient to enable pins 27 & 28 as digital I/Os for non-pi3 models?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 05:40pm 19 Dec 2018
Copy link to clipboard 
Print this post

Any idea why I can't use Pin 13?



my code includes
COIL1=7
COIL2=8
LED=13
SetPin COIL1, dout
SetPin COIL2, dout
SetPin LED, dout

my options that I've set are
Option lcdpanel SSD1963_7,l,,36
Option touch 26,24

and the Picromite manual says 13 can be used as Dout
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10001
Posted: 06:04pm 19 Dec 2018
Copy link to clipboard 
Print this post

Have a look at the pinout on page 7 of the manual
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 06:13pm 19 Dec 2018
Copy link to clipboard 
Print this post

  matherp said   Have a look at the pinout on page 7 of the manual

I did before I chose that pin
[quote]13 DIGITAL_IN DIGITAL_OUT SSD1963-RS ILI9341-CS*

* Recommended usage for compatibility between PCB designs[/quote]
That says Digital out

EDIT: arghh I'm an idiot
I've got 1 Picromite boards
the one I was using was connected to a display, the one I wrote the code for doesn't have a display!!Edited by lew247 2018-12-21
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:49pm 22 Dec 2018
Copy link to clipboard 
Print this post

Does the Picromite have some kind of buffer that fills up each time you tell it to do something?
I'm counting seconds and telling the picromite to print something on certain seconds
but after a period of time - 30 - 40000 seconds (counts) it stops counting and printing, but the program is still running and I can control C to get out of it
 
     Page 3 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025