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 1 of 16 | |||||
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
6x as fast as the Micromite eXtreme, this is MMBasic 5.3 running native on a Raspberry Pi 3 under Raspbian. The picture is of a Teraterm session on the PC connected to the Pi with SSH. If you want to try it, load the attached to your Pi and execute it using the usual Linux syntax "./mmbasic". You may need to execute "chmod +x mmbasic" to set the file as executable. 2017-04-04_151107_mmbasic.zip I don't think it needs anything else installing on the Pi to run - let me know. The code is a port of MMBasic V5.3 with double precision floating point and 64-bit integers. The executable is posted with Geoff's approval. Basic file handling is supported as in the picture but error handling is primitive/non-existent. Time$, date$ and timer are supported but there is no other peripheral support at the moment. The FILE command can be used (without arguments) to list the contents of the current directory (use "Print cwd$" to see where you are) It has been tested with cdeagle's code for calculating solar eclipses and exactly matches the output of the MMX. I'm doing the development on the Pi itself using Netbeans8.2/GCC |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1133 |
WOW! ... today is not the 1. of april? Thanks for the great job! Michael edit: File names are case sensitiv! |
||||
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 1985 |
you are prolific Peter! is there support for the Pi hardware in/out, analogue in etc...? <edit> ah... finished reading the post </edit> cheers |
||||
cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 261 |
Another awesome effort Peter. I'll have to dig out my Pi and give it a try. |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Awesome effort. Once this has peripheral support and graphics the sky's the limit Regards Jman |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9061 |
Impressive. matherp needs an MMBASIC knighthood for all the developement he has done for the platform..... I take it that this could also be run on the Pi Zero-W once development is complete? If so, that opens up a very powerful MMBASIC on a very cheap $5 board - all you need to do is design a host board for the Pi-0W. The MMX still wins in terms of number of I/O pins available, but I dearsay that the Pi with an I2C port-expander chip on it would solve that issue pretty quickly. Nice work, matherp. Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5901 |
I think the winters are too long in the mother country. A small bug: not happy with STEP -1 At the prompt, it does nothing. In a program it is likely to give an error but not on that line. Not sure why I am getting the double prompt but I suspect it is to do with using CD LF pairs in my TeraTerm configuration. I usually have to change it when talking to a Pi. - Yes, changing sending CR on it's own fixes the double prompt (as well as double line spacing). If you want to talk to a Pi with MMEdit, you will have to enable Telnet on the PI and that should only be done within secure networks. It is not something I have tried yet. There is no way MMEdit can use SSH although I will dust off a copy of plink and see what hope there is that way. Well done Peter Jim VK7JH MMedit MMBasic Help |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
Jim Thanks for the report - I've made single vs double floating point a compilation option and missed one instance. Fixed in the attached. I've also added the DIR$ function and an edit capability If you type edit the program will save any program in memory to disk and open it for edit in a simple Linux editor (nano). When you have edited the program type ctrl-O to write the edited version to disk (accept the proposed filename) and ctrl-X to exit the editor. MMBasic will automatically load up the edited version ready for use. This is tested and works nicely using Teraterm on a PC over SSH This allows programs on a Pi to be remotely maintained over the network (NB the Pi 3 has built in wifi) 2017-04-05_092850_mmbasic.zip |
||||
cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 261 |
Ran several of my programs on a Raspberry Pi 2 without any problems. I'm using a USB mouse and keyboard along with an HDMI monitor to communicate with the Pi. Web connection via the Ethernet socket on the Pi. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5901 |
It works well with nano as the editor. When you exit nano, the mmbasic command prompt is there but the nano screen is still showing so the mmbasic prompt is not very obvious. That is something that I have got used to with the limited Linux work I do but it is worth mentioning. If you prefer to write your code on a Windows PC you can easily transfer it to the Pi with copy the code to the clipboard In TeraTerm: NEW AUTO paste the code into TeraTerm (right click) ^C Other useful commands are ^Z or QUIT to exit mmbasic and return to the Pi command prompt. Get serial ports working and I won't have to get my hands dirty learning Python. Jim VK7JH MMedit MMBasic Help |
||||
isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
Does the pi version include lcd screen buttons, cfunctions etc ? (I only ask as part of thinking about the difference between running in interpreted and compiled environments, especially linux etc) |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5901 |
Think of the DOS version but double precision floating point and 64-bit integers. No serial, I2C etc and no LCD (Yet) Being a multitasking environment, accurate timing could be difficult. Pi's are also missing analogue inputs which has always been a bugger. Jim VK7JH MMedit MMBasic Help |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
It will include full LCD support on a limited selection of LCD types. It won't include CFunctions but the Pi version of MMBasic is very fast anyway Correct but I'll support an external ADC (proposals?) in MMBasic Serial, I2C, onewire etc. are all intended to be supported. I believe I can get round the timing issue but MMBasic is likely to need to be run as root "sudo ./mmbasic" I would appreciate help from any Linux gurus as to how to run a copy of MMBasic from boot of the Pi for true embedded applications. It would use the GPIO pins UART as the console. |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
NIFTY !!!!!!! ........ Can this help ? ....... |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3656 |
Do you want it to be run under Linux or stand-alone? Also, do you want a real-time version or happy to be scheduled in whatever way the OS chooses? In effect these may come down to whether you're wanting something akin to the DOS/Windows (EXE) version or want something like on a 'mite. (There's quite a spectrum between these.) Judging by the non-Linux things around you could go for a stand-alone mmbasic along the lines of all the others (except the EXE). Running under Linux of course provides things like TCP/IP (internet), lots of file systems, even virtual memory (not really wanted for mmbasic). John |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
The intention is to run under linux but use some tricks to turn off the Linux scheduler when doing specific real-time actions. The I/O will probably be a combination of pigpio + other bits when needed |
||||
flip Senior Member Joined: 18/07/2016 Location: AustraliaPosts: 114 |
This is brilliant! Once serial is implemented (and if I/O super-speed isn't needed) we can always use a slave uMite (28-pinner under AU$5 in quantity) in command mode to perform all the analogue and digital I/O this will keep all the code and I/O 'mitey. Regards Phil |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
> how to run a copy of MMBasic from boot of the Pi https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ |
||||
cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 261 |
While poking around the applications on the Raspberry Pi, I discovered a very useful text/programmer editor named Geany (geany.org). I pulled in a MMBASIC program and the Geany sidebar displayed the names and locations of functions, subroutines, variables and constants within the source code. It shows the line numbers of these items and lets you jump to their location in the file by simply clicking on the name of the item of interest. Keywords within the file are displayed in bold text. It appears to also "hold" the indentation. Geany appears to be an IDE (Integrated Development Environment). I'm running it on both Raspian and Windows 7. Now to find a way to send the file to the eXtreme! |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
The Pi 3 is ridiculously fast The attached version implements simple digital I/O SETPIN x,DIN [,pullup] [,pulldown] setpin x,dout setpin x,off pin(x)=1 pin(x)=0 ? pin(x) NB: The pin number refers to the physical pin on the 40-pin connector and not the Broadcom GPIO number the following loop has a cycle time of 3.3 microseconds!!!!! [code]do:pin(7)=1:pin(7)=0:loop[/code] 2017-04-06_184832_mmbasic.zip The file must now be run as root to get priority access to the GPIO so use sudo ./mmbasic |
||||
Page 1 of 16 |
Print this page |