|
Forum Index : Microcontroller and PC projects : Raspberry PI 2
| Author | Message | ||||
| G8JCF Guru Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@mbramwel Thanks for the link. IN ALL IT'S GLORY is the key phrase, eg all the SetPin stuff, CFunctions, SetTick, I2C, SPI etc, etc. MMBasic for DOS ported to LINUX is nothing special - I would thoroughly recommend GAMBAS if one wants a LINUX Basic for free - and it's very VB like to boot - and one can do gpio stuff as well. @Grogster The MMBasic Interpreter is 100% written in C, and beautifully software engineered it is too - Geoff's code could easily serve as a reference model for a software engineering university course ! Because the MMBasic Interpreter is all in C, porting to another target is all about 1) Finding a C compiler and friends for the target - gcc and friends does the trick 2) Finding an IDE, eg Eclipse, Netbeans which makes using gcc etc easier 3) Finding the .h files which define all the I/O/Peripheral features of the target - this is a real biggy 4) Finding/writing the .c files to drive the I/O - this is where the chip manufacturer either has to release really good data sheets, or source code (which is what ST and MCHP have done), or compiled object files which can be linked with the users code So the fact that MMBasic works on one ARM MCU unfortunately doesn't help in getting it working on another manufacturers ARM SOC, especially when that other manufacturer isn't exactly keen on releasing important parts of items 3) and 4) above. I've only just got an RasPI C development environment installed - Netbeans with Remote operations against a PI 2 - so it may be that I will find that there is more of items 3) and 4) available than I thought. I'd be really interested to hear from anyone who has written C programme(s) which directly interface to the I/O/peripherals, and would be willing to share some code snippets to help bring me up to speed. Peter The only Konstant is Change |
||||
| hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
" IN ALL IT'S GLORY " I will ask again . Isn't the glory based on Pic chips ? ( not to detract 1 iota ) |
||||
| astroboy Regular Member Joined: 28/12/2014 Location: AustraliaPosts: 41 |
Surely the more platforms it runs on the better? I certainly hope MMBasic might run on Raspberry Pi in the future. I wish I had sufficient knowledge to contribute.
As an aside, I've just discovered Risc OS Pico a minimal BBC Basic which appears to be "plug and play" in the sense mentioned above. Its a free download although they offer to sell it installed on SD cards, and is about 8Mb including example files and a PDF ebook guide or tutor. Interesting, but I'd rather run MMBasic on my Pi.
John |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9750 |
I tried that Pico the other week, and could not make it boot. I was using an older 1st gen model. Perhaps it only works on the new B model? Smoke makes things work. When the smoke gets out, it stops! |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4126 |
If tempted to port I/O to RPi have a look for BCM2835 ARM Peripherals Perhaps read the I/O driver code for any/all of the OSes. For more power, a LOT more I/O, etc - see Olimex (& other) Allwinner boards. A13, A10, A20 all do much more for very low cost. John |
||||
| astroboy Regular Member Joined: 28/12/2014 Location: AustraliaPosts: 41 |
@ Grogster I read somewhere (but I can't find it now) that Risc Os Pico is not yet compatible with RPi B+ although I suspect that they mean RPi2. I'm running it here on an old model B. The first time I tried I couldn't get it to boot either. I then tried with a different SD card and it worked fine. John |
||||
| panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1116 |
@JohnS With respect John, I don't understand your concerns? Geoff has repeatedly stated and made the source available to anyone for their own use to modify to their hearts content. As I understand it, he has also indicated (my apologies to Geoff if I have miss-stated this - please refer to his web site for definitive conditions of use) that you can re-distribute compiled code with appropriate recognition of it's source? I can't see how this is any different from the Linux kernel for example with Linus holding on to release control. As shown by work of your UK colleagues, development on the 470 and ARM cuts have gone ahead with support from Geoff for the benefit of all. Again, no personal offence is intended in my response. Regards, Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4126 |
To know more just spend time reading about what free/open source is. MMBasic isn't. You've not got a good feel for the Linux kernel (or indeed any other free parts) at all. By way of example, if you wanted to port Linux to a new chip you can just do it and release the new sources to the world (and you don't need anyone's permission to start or do any of it, not even Linus's). You can't do the equivalent with MMBasic. I'm not saying that's a problem for other people, but MMBasic isn't open source (in any of the normal variants or meanings of that). It's very generous of Geoff to have done what he has, but the limitations are there. John |
||||
| bigfix Senior Member Joined: 20/02/2014 Location: AustriaPosts: 129 |
Hierarchical/Networked Mites - using IP Networking with a Web based GUI Adding some thoughts from my side to Peters (G8JCF) ideas (Disclaimer : I am not a programmer at all - the last complex program I did was in the 80s, using VAX assembler..) Getting a limited subset of MMbasic on the RPi sounds like a great idea to me We have a good set of mites already, covering most aspects of local I/O, local UI with simple/powerful MMbasic commands But I miss a similar simple way to network multiple mites and bring them to a IP networked/web-oriented world The RPi could add most value as a Gateway/Bridge between the world of MMbasic and a full IP/WEB Linux platform Networking should be transparently integrated into MMbasic and stay simple without to much Linux interaction More complex realtime IO functions should stay at a slaved MMite which is connected to the RPi (I/O Extender as proposed by Peter) As a start I would envision a "simple" hierarchical environment with local and global variables On the RPi we could have a simple webserver - serving an emulated graphical MMbasic display to any remote or local browser This would allow almost complete flexibility with displays (Android Tablets or HDMI local screens) without any MMbasic program changes Example: Assume two networked RPi's (RPA and RPB) each with one directly connected slave MMite as I/O Extender (on I2C or serial ) Each MMite has a DHT22 humidity sensor delivering temp, humid local variables Now assume that the MMbasic on the RPi has a new capability like: Accessing variable "MM1.humid" on the RPi causes transparent retrieval from the local I/O extender MMite Now spinning this further, we could do it networkwide via Ethernet/IP: Accessing the variable "RPA.MM1.humid" on the RPB (second RPi) retrieves the remote MMite value (local to RPA - then over IP to RPB) Of course we will need some initial setup, like Define Slave MM1 = I2C address xyz or MM1 = COM1 (On RPA, RPB) Define Node RPA IP 10.0.0.5 (Define IP Address of Peers) To simplify things it may be feasable, that only reads are possible across the network - so no locking issues come up This is by no means a well architected proposal - but I hope that more and better ideas will get triggered |
||||
| G8JCF Guru Joined: 15/05/2014 Location: United KingdomPosts: 676 |
NO, Microchip doesn't have a monopoly on I/O on MCUs ! Peter Mather has demonstrated that STM32 MCUs can run MMBasic "In All Its Glory" and then some more on top The Broadcom MCU used in the PI has loads of I/O, just that driving them from C will be different from how they're driven from C in PIC32 and STM32 chips - if we do it correctly, then the MMBasic user will just use all of the usual MMBasic commands and functions to interact with the I/O. @JohnS - thanks for the tip, much appreciated - could U please point me at where I might be able to download a binary toolchain for the PI please (Netbeans in Remote mode into a PI 2 is pretty good, but nowhere near as fast as my 4 core I7 ? The only Konstant is Change |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9750 |
100% Open Source is a nice CONCEPT. If you have not already read the article on Geoff's site, have a look at this page for Geoff's explicit reasons for his current license, and note that in the first instance of the Maximite, MMBASIC actually WAS fully open - it is only because of what happened to him, that he changed it. After reading that article, I can certainly see why he changed the licence.
I only say all this in case you had not read that article - I by no means want to upset our otherwise irritate you or any other open-source advocate. I am just offering an explanation is all.... Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9750 |
You could use the likes of a WizNet 107 network module, as I have done on a couple of occasions. This gives any serial device access to the LAN or WAN with port-forwarding. In my case, I was able to easily talk to a MM from anywhere on the network or via the Internet, once the module was correctly configured. I just had the network module connected to the Maximite console on COM1(I had to open COM1 as console locally first), but then I could talk to it from anywhere, so long as you knew the IP and port number. Another member here even tested this on an International level, and left me a wee hello message on my Maximite screen when I sent him the connection details. Perhaps my next PCB should be a NetMite!
EDIT: Changed 107 link for a better one with more detail. Smoke makes things work. When the smoke gets out, it stops! |
||||
| G8JCF Guru Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi G 100% Open Source is an analogue for Anarchy IMHO and often for the commercially astute to take advantage of the technically able for free, ie I agree with your sentiments. Fork upon fork upon fork ... Darwin got it right, so, the "useless" forks will eventually wither and die, but how many punters will have wasted precious time/resources/money on these dead-ends. As I understand it, if one wants to release LINUX for a platform, then because the word LINUX is trademarked by the LMI, if that release (the Kernel specifically) has not been approved by Linus Torvalds, then one cannot call/name/market it as LINUX. I'm not a lawyer, but common sense reading of the various articles regarding LINUX tend to suggest that unless Linus Torvalds approves of the kernel, then what is being released can't be called LINUX. What this boils down to, IMHO, is being willing/unwilling to submit one-self to the judgement of another person, in the case of LINUX, Linus Torvalds; in the case of MMBasic, Geoff Graham. Personally I am willing to accept Geoff's judgement as to what's in or out of MMBasic. In my experience, I have found that that GeoffG is VERY open to new ideas/suggestions SO LONG AS THE PROPOSER IS PREPARED TO BACK IT UP WITH EFFORT & COMMITMENT. Carping on the sidelines is easy, making a real, tangible & positive contribution to MMBasic requires "real skin in the game". Peter The only Konstant is Change |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9750 |
I had not heard of that one - can you believe the balls on that S.O.B?! (rhetorical) If there is money to be made, some Humans out there are all for ill-gotten-gain. Smoke makes things work. When the smoke gets out, it stops! |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4126 |
The US legal mess (it's not a system) regularly proves to be broken. It's hardly relevant, though. In any case, even though Americans often think their laws apply worldwide, they don't. A bad guy couldn't do the trademark thing here, well maybe our guys would fail in their duty but failing that, no. It all misses the point, since if one ported Linux as I said then even worst case you just call it XINUL or whatever. Duh, big deal. That happened all the time when UNIX System was being protected by AT&T as their trademark and it made no real difference. SUN sold lots of computers running something everyone spoke of as UNIX and people just got on with treating it as UNIX. It didn't work so well for Xenix on a 286 due to Intel's crippled memory model, but the 68000 variants of UNIX did well. Etc. AT&T didn't have a say and no-one cared. They protected their trademark but for what? Only their lawyers know, if indeed they do or did. I couldn't count the number of differently-named UNIX systems I moved C programs between just by recompiling. The biggest problem was often trying to find media they shared - source on magnetic tape for a system with 8" floppy was a problem. Source on 5.25" floppy was a problem for a 3.5" system. Compiling was easy in comparison. Of course maybe if someone just released Geoff's source he wouldn't actually sue. Such cases are fraught with pain and costs, especially if in a foreign jurisdiction. I can't say I care about the legal issues since I don't intend to fall foul of them. Software patents do worry me and are plain daft. I may fall foul of them without even knowing or having any way to tell in advance - may already have done so. The legal mess has got them wrong but hey that's not untypical. Geoff may have fallen foul, too. It's impractical to try to find out. Anyone tried? I suspect no-one here has. We all just get on and hope not or that it won't matter. Overall, I think legal issues around Linux can be ignored by all but the predatory, desperate, greedy or the like. Probably the same applies to MMBasic. Case in point - anyone really think Chinese/Korean/etc firms checked with Linus Torvalds that it was OK to put Linux on their chips? What remedy would there be? China didn't even have copyright laws till quite recently. (I don't know about trademarks there but hey they used to make Sheffield Steel - no, really! - which does rather point the way. That may have been Japan but it's the same thing: different jurisdiction, different laws, impractical or impossible to pursue remedies.) John |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4126 |
You can use any ARM gcc for the CPU in the RPi. Ditto for the different CPU in the RPi2. You may need to say which ARM variant, but that's about it. You're already doing the same thing if using gcc with the STM32 so just tweak the args to gcc and go. Using makefiles this is easy and allows lots of target CPUs all to be supported with quite small effort. That's what has worked so well for Linux (and before it, UNIX). Also works for OpenBSD etc. Oh, and bootloaders such as U-Boot. I'm struggling to think of any successful, complex, multi-architectured, etc, C (or C++) software that doesn't use makefiles or the like to do it, but I expect something doesn't. For those who don't know, the typical Linux package can be built from source and installed like this: ./configure make sudo make install That's it. Doesn't matter what CPU you're sitting at. It's often not much harder to cross-compile though only a fraction of people ever wish to (because they don't happen to develop software for other CPUs or use anything but the system in front of them). For the RPi/RPi2, you may just find it easier if you're not used to software portability in its established sense to compile on the RPi/RPi2. They're fast enough for most things that aren't huge. In that case, I'd stick an hdd on (via USB or whatever) or use files over a LAN. John |
||||
| Gizmo Admin Group Joined: 05/06/2004 Location: AustraliaPosts: 5157 |
Think we should probably steer away from the open source discussion. Its a sensitive topic for a few of us who have tried the open source path in the past with software we developed, and have been disappointed and disheartened with the results of sharing our code. Sometimes, going open source is a quick way to kill a project. I think Geoffs' approach is working very well. Those who were on the forum a few years ago will remember the often heated discussions regarding open source, and I feared at the time the Maximite would cease to be developed further. I dont want to see that happen again. Glenn The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
| G8JCF Guru Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi re compiling "stuff" for Raspi. I've found two (2) approaches which work 1) Use Netbeans in the "REMOTE" mode where gcc etc is on a real RASPI 2) Goto http://gnutoolchains.com/ and download/install the toolchain for PI and then add that toolchain into Netbeans. Option 1) is really simple/dead-straightforward, and with a PI2, compilation times are really fast. Option 2) is even quicker than Option 1, but you have to also factor in the time it takes to transfer the executable onto the target PI - with 100bps Ethernet, the xfer time is almost instantaneous for all practical purposes. @Gizmo re Open Source Personally I am NOT an unequivocal fan of the Open Source philosophy. LINUX is, "apparently" a (perhaps the principle) examplar of Open Source, but it (LINUX) is still a bit of a wall-flower IMHO. Android is of course LINUX, so Android brings an overwhelming user base to the Open Source community, and even IOs is in reality UNIX underneath all of Apple's marketing (which is probably the best in the world!). The reason why I'm not 200% an Open Source fan is that as a programmer/coder, I've seen non-programmers/coders "steal" / misappropriate / "borrow" code for their own profit, and, to rub salt into the wound, without acknowledgement of the progenitor/originator/author of the code, ie the person/people who actually created the IP don't get rewarded for their intellect/hard-work/insight/skill - the people at the coalface seem to get dismissed as just technical lackeys - yes I am bitter and twisted about IP theft !!!! G'nite Peter The only Konstant is Change |
||||
| paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Glenn I agree with that Glenn. It wasn't pretty then and I also worried about Geoff bothering to maintain his interest. Luckily for all of us he has, and it's all just gotten bigger and better. Greg |
||||
| G8JCF Guru Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Still "bitter and twisted" about IP theft !! The only Konstant is Change |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |