Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:29 05 Jul 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 : Introducing the Pi-cromite: first steps

     Page 10 of 16    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 04:19am 06 May 2017
Copy link to clipboard 
Print this post

One more tweak

5.3.a21

2017-05-06_140419_mmbasic.zip

This version fixes the formatting of output from a SYSTEM command

Also, the code now properly implements OPTION DISPLAY height, width

So if you set "OPTION DISPLAY 36,132"

Then when using the editor, assuming the screen window is big enough, you will be able to edit in the bigger window.
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 05:19am 06 May 2017
Copy link to clipboard 
Print this post

Hi matherp

Using : 5.3.a21
1) I note this: I have a process in linux that use Raspy/Uart0 (GPIO14/15) it's all OK, but when I start "./mmbasic" UART0 it ends up working. OK I use GPIO on mmbasic it's OK, when I quit from "mmbasic" UART0 It still does not work. I think that as long as "mmbasic" is not required pin, this should not be blocked. I think a linux system would be more interesting this feature.
2) Thanks for editor integration. But Can You create an "option" to use also linux editor as "nano" instead?. I used "nano" in a16 version and I was very nice to use linux's editors.

Thanks
sagt3k
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 06:00am 06 May 2017
Copy link to clipboard 
Print this post

  Quote  If required you can still use nano using the command NANO


I don't understand the issue with UART0. As long as you exit MMBasic with ctrl-Z or QUIT then the code closes pigpio which frees up the pins. I can only assume that there is some initialisation of UART0 done in the LINUX boot sequence. In which case you would have to find it and re-run it to reset UART0
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 07:08am 06 May 2017
Copy link to clipboard 
Print this post

Now you can edit with mouse cursor positioning

5.3.a22

2017-05-06_170217_mmbasic.zip

While in the editor the left mouse button can be used to position the cursor. Just click on any character and the edit point will move to just before that character with the cursor on the character. Click just after the last character in a line to go to the end of that line. Click well past the end of a line to go to the start of the next line.

The mouse wheel can be used to scroll up and down the file.

Please don't ask for cut & paste and/or drag and drop, this is as far as mouse control goes!

As before this is tested via SSH using both putty and teraterm. Feedback on local use appreciated.


 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 08:09am 06 May 2017
Copy link to clipboard 
Print this post

Hi matherp

I run 5.3.a22 on RaspberryPI3

Follow these steps:
1) start minicom on /dev/ttyAMA0 (I connect on UART0 of raspberry a Micromite), you can see, I'm editing code on micromite on UART0<-->MICROMITE console.. OK!!
2) start pi-mmbasic, run a simple code. OK!!
3) quit from pi-mmbasic. OK!!
4) try to start again minicom on /dev/ttyAMA0, UART0 not answer. NO!!!

I tried to go out and go back to minicom. nothing to do. The only solution is to restart raspy.




Thanks
sagt3k

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 09:09am 06 May 2017
Copy link to clipboard 
Print this post

  Quote  The only solution is to restart raspy.


As I said in my previous post. Something in the boot up sequence is setting the pins to UART mode which is an alternate setting. PIGPIO is setting them to standard digital I/O. When MMBasic exits it leaves all the pins as digital inputs i.e the only guaranteed safe mode - exactly the same as the Micromite. To solve this you need to find the boot code that does the setup and then run it after you exit MMBasic.
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 10:38am 06 May 2017
Copy link to clipboard 
Print this post

Hi matherp
Ok, I don't know PIGPIO and I do not know how you initialize the pins at mmbasic startup. Can You lock pins only when we call "setpin" or "open" "I2C", "SPI" etc and release with "setpin x,off", I2C close, SPI close etc.. etc ?
In linux It would be very nice to give the possibility to multiple processes to use different GPIO(not share pins at same time). For example I use "freepascal" to acquire data from UART0, bash file to verify GPIO status and python to read other GPIO and drive and shoot from camera all at the same time.
Thanks
sagt3k
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2428
Posted: 11:26am 06 May 2017
Copy link to clipboard 
Print this post

i've been chatting to a friend who is an embedded linux guru, trying to persuade him to agree to offer some linux advice. one thing we did discuss is how ctrl-Z works: it does, by default, not close an application but merely suspends it, with the linux commands FG and BG unsuspending the application in either the foreground or background.

how are you currently handling ctrl-Z?


cheers,
rob :-)
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 12:08pm 06 May 2017
Copy link to clipboard 
Print this post

Hi robert.rozee
I think that the problems is PIGPIO daemon. Now I'm trying to use command "pigs" while run "mmbasic" on other instance and viceversa.
I'm doing tests using different software PIGPIO daemon.
sagt3k
 
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 03:13pm 06 May 2017
Copy link to clipboard 
Print this post

Hi Mathers
I am running the latest version of mmbasic with screen and keyboard no problem the colour works in edit.
The one strange thing is if I run a simple for next loop using print "hullo world" it prints out 4 times when the loop is only for 2.

For t = 1 to 2 : print "hullo world" : next t

I haven't tried anything more complicated yet.


Cliff
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6268
Posted: 04:27pm 06 May 2017
Copy link to clipboard 
Print this post

  centrex said   Hi Mathers
I am running the latest version of mmbasic with screen and keyboard no problem the colour works in edit.
The one strange thing is if I run a simple for next loop using print "hullo world" it prints out 4 times when the loop is only for 2.

For t = 1 to 2 : print "hullo world" : next t

I haven't tried anything more complicated yet.


No problems here headless with teraterm.
BUT! when I try and EDIT the code then press F2 to run it, I get the two runs through the program.

Can you try
For t = 1 to 2 : print "hullo world";t*10 : next t


It is printing
  Quote  hullo world 10
hullo world 20
hullo world 10
hullo world 20


Jim

VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6268
Posted: 05:09pm 06 May 2017
Copy link to clipboard 
Print this post

OPTION COLOURCODE ON doesn't seem to do anything.
Using Teraterm on a headless Pi.

Version 5.3.a21

Jim
VK7JH
MMedit
 
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 07:12pm 06 May 2017
Copy link to clipboard 
Print this post

Colour code seems to work in edit ok.
PI Zero with screen keyboard and mouse which all seem to work as expected.
I have found the for next loop works as it should when in terminal mode.
It is in edit mode that it two times what the loop is.
Another strange thing when invoking mmbasic via sudo ./mmbasic a large amount of information flashes up the screen the same thing happens in edit mode.
This does not happen in terminal mode once you get past the sudo ./mmbasic .
The above also happens using ssh.

Cliff
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 09:30pm 06 May 2017
Copy link to clipboard 
Print this post

Thanks for the reports

The issue was that the program was being run twice when F2 was used to exit the editor. This was another consequence of the merge of Micromite and Maximite code that I use in the Pi-cromite: Mostly Micromite but Maximite for program memory handling as the code isn't stored in flash.
Anyway: trivial one line change so I haven't updated the version number

2017-05-07_072013_mmbasic.zip

Jim: I don't know why you aren't seeing colour in Teraterm. This is my configuration




  Quote  one thing we did discuss is how ctrl-Z works: it does, by default, not close an application but merely suspends it,


ctrl-Z (and ctrl-C) is/are being trapped by the program and it does do a full exit in response to ctrl-Z. I am not using the pigpiod daemon as this has limitations which would not work for the Pi-cromite. The pigpio code is linked into the Pi-cromite code. This is why you can only run one instance of the code running. I will look at having an option setting that defines which pins the Pi-cromite takes over but the current approach is that the Pi-cromite takes over all I/O in the range gpio2 - gpio31



Edited by matherp 2017-05-08
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6268
Posted: 07:44pm 07 May 2017
Copy link to clipboard 
Print this post

  matherp said  
Jim: I don't know why you aren't seeing colour in Teraterm. This is my configuration


I still can't get colour using teraterm.
Putty is OK so it's not mmbasic or the Pi settings

With TeraTerrm I get colour from other micromites and 'some' colour from the Pi's command line.
That is 'some' but not as much as when using Putty.
I can't see any obvious setting in TeraTerm but it must be the way it negotiates it's capabilities with the PI when first connecting. I can monitor things if I connect using Telnet but not with SSH.

Can you send me a copy of your TERATERM.INI file and I will try and find where the difference is. It's starting to bug me.

I have tried a couple of different versions of TeraTerm

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 08:22pm 07 May 2017
Copy link to clipboard 
Print this post

Teraterm V4.86

2017-05-08_062218_TERATERM.zip
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6268
Posted: 08:59pm 07 May 2017
Copy link to clipboard 
Print this post

Thanks Peter,
I ended up deleting my INI file(s) and reinstalled to get a full clean INI file with comments.
Now I have to try and work out exactly which setting it is that took away the colours.
The default settings with nothing more than font size changed works well.

Having yours to compare with will help.
I ended up running V4.94

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10201
Posted: 07:11am 10 May 2017
Copy link to clipboard 
Print this post



Please find attached V5.3.a23

2017-05-10_170859_mmbasic.zip

This includes a bit of tidying up and also full support for the SSD1963 displays (not though as a console)

pinout is:

SSD1963_pins
SSD1963_WR_PIN 32 //GPIO 12
SSD1963_RS_PIN 13 //GPIO 27
SSD1963_RESET_PIN 31 //GPIO 6

SSD1963_DAT1 35 //GPIO 19
SSD1963_DAT2 38 //GPIO 20
SSD1963_DAT3 40 //GPIO 21
SSD1963_DAT4 15 //GPIO 22
SSD1963_DAT5 16 //GPIO 23
SSD1963_DAT6 18 //GPIO 24
SSD1963_DAT7 22 //GPIO 25
SSD1963_DAT8 37 //GPIO 26


Option syntax and all GUI/drawing commands are exactly the same as the MM+ and MMX

e.g.

OPTION LCDPANEL SSD1963_7,RL,,33

In this example pin 33 is used for RD to allow transparent text and BLIT to be used.

Performance on a Pi 3 is reasonable (Image Load is very fast). Somewhat slower on a Pi-zero (800x480*24 image loads in 0.873 seconds)




Edited by matherp 2017-05-11
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 724
Posted: 10:00am 10 May 2017
Copy link to clipboard 
Print this post

Hello Peter,

do you have a plan to use this display as console ( stdout )?

Nice idea, but if the pi support's this display in any other way not worth to think about it...


Edit,

Ok, answer myself.
Seems to work with this fbtft

Link



Edited by atmega8 2017-05-11
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 121
Posted: 06:57pm 11 May 2017
Copy link to clipboard 
Print this post

hello Peter,

this is a great project, many thanks for your work
I bought my first raspberry to stay uptodate and have this connected to a TV screen via HDMI. run mmbasic and everything worked
I have my "LED star" at raspberry tested and it worked !

I want to use a TV screen or an HDMI display, the raspberry offers this

But how can I create an output over HDMI? not this black CLI Window
I think we need a new command like "window" or "screen" with variable size , background -colour and maybe a backgrund picture

or am I wrong and there is already available ?


best regards Ronald
 
     Page 10 of 16    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025