![]() |
Forum Index : Microcontroller and PC projects : Introducing the Pi-cromite: first steps
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10201 |
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: ItalyPosts: 313 |
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 KingdomPosts: 10201 |
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 KingdomPosts: 10201 |
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: ItalyPosts: 313 |
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 KingdomPosts: 10201 |
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: ItalyPosts: 313 |
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 ZealandPosts: 2428 |
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: ItalyPosts: 313 |
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: AustraliaPosts: 320 |
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: AustraliaPosts: 6268 |
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 Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6268 |
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: AustraliaPosts: 320 |
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 KingdomPosts: 10201 |
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 ![]() 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 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6268 |
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 KingdomPosts: 10201 |
Teraterm V4.86 2017-05-08_062218_TERATERM.zip |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6268 |
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 KingdomPosts: 10201 |
![]() 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) |
||||
atmega8![]() Guru ![]() Joined: 19/11/2013 Location: GermanyPosts: 724 |
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 |
||||
RonnS Senior Member ![]() Joined: 16/07/2015 Location: GermanyPosts: 121 |
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 |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |