Picaxe what next?

stan74

Senior Member
Yes hippy, an overclocking test. The rpi was a non profit educational idea that has took off but I wonder how many find it easy to use. On the other hand it has scratch :) As a what next option..to do what? I tried using the gpio pins with python, it's slow considering it's running at 1GHz. I'll try using the 3rd party pigpio library with freebasic when I get into it more.
The arduino, it's just a chip and on the standard boards it seems, there's not many pins to play with.
I reckon a lot of people find picaxe difficult at first. I knew what I wanted so it was just syntax and a bit of help. I wanted to make a robot and had one running in a few days. I keep a browser open when I use a rpi because I'm constantly copy/pasting stuff. Seems to take hours to get anywhere. Pretty complicated really.
You said a 1k buffer could be written in 30ms. The i2c oled I used was slow maybe? The line drawing code seemed optimal in the end but the lines didn't just appear and I bet they do on the RE ledo42, why, because it uses a dedicated pic.
If what next means speed then gcbasic seems best if you can only use basic and it's probably faster than C. You'd need to see the code produced. It's surprising what a picaxe can do,not what it can't. I re-wrote one robots code to learn gcb syntax but didn't programme a pic because it's ok as it is. As for lcds,I bought a nextion to save the bother.
 

BESQUEUT

Senior Member
The arduino, it's just a chip and on the standard boards it seems, there's not many pins to play with.
There are many boards Arduino compatible. Some are very cheap.
Some are powerfull (look at Teensy 3.6)
All can be programmed with a standard USB cable and same programming environment.
 

stan74

Senior Member
"Arduino has D0-D13, and A0-A5 which are also D14-D19.
D0 & D1 can be used as regular data pins if you do not need UART/serial comms."
So much for youtube tutorials.
"and same programming environment." I know. Not for me. I suppose there is a boot loader for usb.
 

SteveDee

Senior Member
...The rpi was a non profit educational idea that has took off but I wonder how many find it easy to use...
Easy to use for what?

Because the Pi is a computer, rather than a controller, it has a lot more complexity. Which is often a good reason for NOT using a Pi for relatively simple (and not so simple) control tasks. A Picaxe uses a lot less power, it doesn't take 30 seconds to boot, its not picky about the power suddenly being removed, and it just follows your program (i.e. it doesn't get distracted by other unrelated tasks).

On the other hand, the Pi can do lots of stuff that is (probably) beyond the Picaxe. And working with the GPIO (digital inputs, outputs, serial comms & so on) has been made easier with a wide variety of languages thanks to libraries such as wiringPi and pigpio. You don't have to stick with Python (although it does a great job). Gambas is my language of choice as it is similar in some ways to VB6.

If you are interested, take a look at: http://elinux.org/RPi_GPIO_Code_Samples.
 

MFB

Senior Member
For those Python fans who don't want the overheads associated with a full blown microcomputer (power consumption, boot up time ext) Micropython could be the answer.

Unlike running Phython under Unix on the Rpi, Micropython is both the langauge and the operating system.
 

stan74

Senior Member
While picaxe and arduino have much in common,the rpi is capable of the same stuff and more, I bought one when they came out and thought "more linux guff..oh well". I don't use them much for electronic projects and the real stuff I use windows. I gave my daughter a rpi 3 with osmc and she was happy. It's more for clever robots with cameras for obstacles......but that's a dream :) c'mon,wouldn't you like an "intelligent" robot that could find a packet of crisps from one scan. Go fetch, init?
 

stan74

Senior Member
PS I bought a waveshare 4" rpi lcd touch screen. It's spi whatever and sits on the rpi and works ok with the jessie cd image supplied. The screen is 320x480 and changing the main screen hdmi to lower res doesn't change the lcd display so it's pretty useless but only cost £12. It could work with a picaxe but no control code griff or info unless it's generic.
 

stan74

Senior Member
------------------------------------------------>cmucam
I'm fascinated by the multiple face recognition on my camera. Just change face to crisps...or have both. Crisp/face recognition.
Then you could confuse it by printing a face on a packet of crisps :)
 

hippy

Technical Support
Staff member
As displays for other computers have been brought up it's worth noting that some are displays without memory; are effectively 'TV screens' and need to have their images continually refreshed at high frame rates which are not suitable for direct PICAXE use. They can usually be identified by having a large number of connections.
 

BESQUEUT

Senior Member
I'm fascinated by the multiple face recognition on my camera. Just change face to crisps...or have both. Crisp/face recognition.
Then you could confuse it by printing a face on a packet of crisps :)
I do not think that you are able to connect your camera to a Picaxe.

With a cmucam, YES YOU CAM !

at least with SPI.
But this one is not able to recognize face...
For packets of crisps, I don't really know, but maybe...
 

stan74

Senior Member
SteveDee, your link looked like C stuff and I don't do it. If I did and found it easy I wouldn't be using picaxe. Picaxe can't be c or then it would be a pic. If picaxe was interpreted c or python, would it be popular? I can only do rpi graphics in new to me freebasic. I could draw lines and circles within minutes but wouldn't know where to start with python. Basic should have been included in rpi. Must have been free linux basic available when it came out.
 

SteveDee

Senior Member
SteveDee, your link looked like C stuff...
Hi stan74, well I included the link only to show that there is Pi help for a wide range of languages. If you go further down the linked page you will find examples for RTB (Return to BASIC) and bwBasic. Here is a bookmark: http://elinux.org/RPi_GPIO_Code_Samples#BASIC

I don't know why some kind of Basic was not included in the Pi, but there are lots of different blends of Basic avilable for free download.

However, I'm not suggesting you abandon Picaxe, only that there has never been such a wide choice of low cost technology available to the hobbyist. For example; just £4 for a Pi-Zero, that's amazing.

And of course its good fun to mix technologies in the same project, like my Picaxe-Pi birdbox, where the Picaxe controls power to the Pi and lets the Pi know how the battery is holding up.

The only thing that is in short supply is time! (...as in 'time to play' with all this exciting stuff!)
 

stan74

Senior Member
"The only thing that is in short supply is time! (...as in 'time to play' with all this exciting stuff!)"
I order things on ebay that look interesting ,they take ages to arrive at once and what shall I spend time on,the nextion lcd or the knock off rpi lcd,or the the sharp sensor or sort that line follower. Latest thing that actually worked was getting a hantek scope to run on win 10 and that was an accident. Some hobbies are less demanding.
 

bag57pipe

New Member
I have many more years behind me than I have in front of me (morbid but true) therefor have reached te age where I can be set in my ways and grumpy, however even when I was young and fresh faced change for changes sake seemd absurd. I sometimes wonder if the hobby has lost it's way. A lot of simple tasks seem to have got very complicated MPLABX would probably give an old CrayI a headache. I could word process on a 16K Tandy model 1 I dont think I could put my name on the header with 16K in MS word. Back in the in the digital stone age I remember expressions such as the operating system should be transparent to the user try telling that to IT the next time they say " Youre doing it wrong th system expects you to.........". For amateur use I think basic is a good choice as it is the nearest language to plain english I have a resonable grasp of english (geordy english) . If interpreted < assembler goto compiled .There picaxe chips have more features than I could ever want but occasionally a couple of lines of machine code is uesful, I know the picaxe is an educational tool which to me is a good reason to alow some method of using a bit of machine code, I think the good old user call had a lot going for it. I had a go at making an electronic bag pipe instead of trying to stuff the touch sensing and tone generation into one chip it was easier to separate the functions into two chips the sound function will not run in the background I found the resolution of the pwm generator was ok to within about 5 cents of the correct pitch. The next sage was to generate digitised sound but the picaxe is too slow ,a short routine in assembler to fetch sample load sample return to calling routine was all I needed instead I will have to spend weeks learning a new systems. I have a BAS800 (£35.00) programmer that is useless because PE 6does not support it and the PE5 version will not run on 32/64 bit windows 7/8/10 systems worse still it is still on sale. Ok I know the old stuff like my tandy can be stuffed into one PIC32 chip draws about 50mA and is great the original drew about 5A and got quite hot it took about 2 minute's to load a tape (not good) my work PC with firewall net nany and trust spyware took 5 minutes to boot what did i gain !
 

Goeytex

Senior Member
...PE5 version will not run on 32/64 bit windows 7/8/10 systems
Sure it will, I am running it now on Windows 10 And Window 7 (32bi and 64 bit).

If you need help diagnosing wny you may be having trouble and getting that resolved, just ask and the folks here will help you get you up and running.
 

Jeremy Harris

Senior Member
PE5 runs fine on Linux under Wine, too, now, but you need to fiddle around and copy over some DLLs to get it to work. Once that's done it's no different to running it on a Windows machine. I can confirm it runs just fine on Windows 7, too, as I still have one machine running that (although it's about to get switched over to Linux, as I'm sick and tired of doing battle with Microsoft over their constant privacy intrusions, all of them behind my back in the form of "updates").

If someone could find a way to get PE6 running under Linux that would be a real boon.
 

Circuit

Senior Member
PE5 runs fine on Linux under Wine, too, now, but you need to fiddle around and copy over some DLLs to get it to work. Once that's done ...
Jeremy, would you possibly write up some procedural guidance notes on just how you "fiddle around" and which .DLLs need to be sourced and copies over? I think this would be much appreciated by those, like myself, who are just dipping their toes into the world of Linux. I have installed ZORIN which seems a very fine system and includes Wine in the package. Although I am really locked into PE6 - I really appreciate the additional features over PE5 and the workspace interface - but there are times when I would be happy to drop back to PE5 on my Linux machine.
 

steliosm

Senior Member
You don't actually need much to make PE5 to run under Wine. You run the setup.exe and install it in any folder you would like, just like you would do for any application. At least, this is how I still use PE5 on my linux desktop running a 6 years old Ubuntu version. I didn't need to install any DLLs. In case you do need to install a DLL, you can use the winetricks app to make the installation. You will now if you need this during the setup/running of the app.

You also need to configure the serial port though. This is done under ~/.wine/dosdevices where you soft link (ln -s) your win32 com ports (eg. com1) to your real serial ports (eg /dev/ttyUSB0). You then just use com1 in the references in order to program the chip.
 

Jeremy Harris

Senior Member
I needed to install MFC40.dll to get it to work, and back when I did it there wasn't a quick fix with Winetricks, but now I think there is. Either way, you need to get hold of the dynamic link library, MFC40 and load it into Wine.

Once that .dll is loaded and registered all works perfectly. Without this, PE5 just hangs at the start up screen, IIRC. There are now better instructions for installing MFC40.dll, in the last update to Wine on PE5, here: https://appdb.winehq.org/objectManager.php?sClass=version&iId=28206

I'm running Mint 18 now, and every upgrade I've done since Mint 13 has just carried over the fix for PE5 OK.

As above you also need to grant permission for the normal user to access the port you're using, just as you have to under Linux anyway. In my case I have a dedicated "bench" machine I built, with a motherboard that has a proper serial port and LPT port, as well as 6 USB ports, and I use a real serial port for programming Picaxes, using the old serial cable, the AXE026, that I originally bought at least 10 years ago, a I don't think I've had a machine with a real serial port for that long, until now! I have to say that I find that programming with a real serial port always seems quicker than using the AXE027 USB to serial adapter on a Windows machine. I've no idea why, but I've timed a few downloads and they always seem just that bit faster with the serial port.
 

geoff07

Senior Member
I thought for a moment that Stellios and Jeremy had solved the PE5 under Wine problem for me. But sadly I still get "Run-time error 339: Wave32.ocx or one of its dependencies is not correctly registered: a file is missing or invalid". I have in the (distant) past tried to fix this with no success. I got the same issue before adding MFC40 so that probably wasn't a problem for me anyway. Any help appreciated.

I run PE5 (and PE6 if I must) under Virtualbox/xp quite easily, fine on my desktop mega-brute but (esp. PE6) cumbersome and slow on the little Dell 910s that I use as laptops (~£40 on ebay and ideal for programming in front of the telly). I use Ubuntu (latest LTS) on all machines for simplicity, sharing files on Dropbox. The one-hand-holdable Dells mean I can easily install new code on embedded household systems (garage door, heating scada, led lighting etc.).

I understand what softlinks are, but not what "This is done under ~/.wine/dosdevices" means, as this is a directory. Do you have to add a script? If, so, which sub-directory? I don't think this is related to my problem, as I can of course execute the softlink from the terminal.

The system is a big box with Ubuntu 16.04, up-to-date, and an otherwise untouched Wine.
 

steliosm

Senior Member
Have a look here for the wave.ocx issue: https://appdb.winehq.org/objectManager.php?sClass=version&iId=10768&iTestingId=20755

As for the serial port, you just need to create the .wine/dosdevices folder if it doesn't exist and then inside that folder just create the soft links, eg ln -s /dev/ttyUSB0 com1. Also make sure that your user is able to use the serial ports, by adding him to the dialout group: sudo adduser <username> dialout (need to logoff and logon again).
 

geoff07

Senior Member
Well, things have moved on since I got distracted from what I was intending to do this morning! But it still isn't working.

I have discovered that

- the Wave32.ocx problem is in fact the MFC40.dll problem.

- 'Winetricks MFC40' does not work as the program fetches the file from Microsoft, and they have kindly removed it from their site.

- You can download MFC40 yourself from many sites, but I personally don't want to do that as I don't trust their intentions

- however, you can extract it from a Windows CD using cabextract (on Linux). I put it into ~/.wine/drive_c/windows/system32. On my cd the file was in /WinXPHE_SP3/i386/MFC40.DL_ but this is a slipstreamed cd so yours might be different.

- registering using: wine regsvr32 "C:\windows\system32\wave32.ocx" fails:

err:module:import_dll Library MFC40.DLL (which is needed by L"C:\\windows\\system\\wave32.ocx") not found
Failed to load DLL C:\windows\system32\wave32.ocx

This happens even if executing the wine command from the wine directory that contains mfc40.dll (and regardless of filename case - Linux can be picky about cases).

So if anyone knows how to register it correctly, please advise. I'm sure it is a simple thing but right now I am running out of patience!

Just saw Stelio's response, thanks for that, but as you can see, not yet successful!
 

Jeremy Harris

Senior Member
I'm pretty sure I extracted mfc40.dll from a Windows XP install disk, but it's so long ago now that I've forgotten exactly what I did! I do know that I found it frustrating, in that there were various mentions of the mfc40.dll problem on the web. I seem to recall that the issue was with getting Wine to register the dll, and once I'd cracked that PE5 just worked.

I've been tempted to install a cut-down version of XP on a VM so that I can run PE6, but to be honest, I prefer the PE user interface, and find PE6 a bit less intuitive to use. Axepad for me is just unreliable on Mint 18 (and was on all earlier versions of Mint). As Mint is Ubuntu-based, and there are Ubuntu users who don't seem to have the random file save crash problem I've always had with Axepad (on three different machines) I'm not sure what the problem is. Others here have reported the same problem on the Axepad thread, and it seems to be something specific to do with file handling that causes the problem, and isn't a specific Axepad problem, apparently (although there's no other Linux software I've used that exhibits any problems like this).

I have found that you can invoke the programming software from the command line, and bypass Axepad or PE5, and that works OK.
 

geoff07

Senior Member
Well some progress is being made. Trivially simple it seems. I copied the MFC40.dll file into other directories ( /system, and /windows) within wine, and now it registers. I should have done it one directory at a time, to isolate the right one, but I didn't.

PE5 then starts properly with no apparent errors.

So the advice to put MFC40.DLL in system32 is wrong, in my case at least.

Hopefully this will be a help to any others suffering this problem.

To summarise:
- install PE5 using wine (i.e. right click on the BAS805.exe installer and select install with wine)
- find a copy of MFC40.dll and save it to (most likely) /system, not using winetricks. My file is 924,432 bytes dated 17Aug2001 in case you get it from a random website and want to check, but mine was from a Windows install disk which I recommend as it will be clean.
- wine regsvr32 MFC40.dll
- done

Thanks for the various inputs.

On AXEpad, I haven't used it since trying it years ago as it seemed extreeeemly slow and had funny character graphics. Maybe I should have persevered. But virtualbox is pretty good, and free, and I have non-oem xp licenses (bought for $30 in the company store in Seattle on a client visit years ago when I had a job), so that has served well on the big box. Hopefully now the little Dells will perform a bit better under a native PE/Wine.

Phew!
 

geoff07

Senior Member
There is another problem with running PE5 under Wine. Inserting the AXE027 into a recent linux does not generate the /dev/ttyUSB0 device that is needed for the symlink to Wine. Advice (including the Rev-Ed axe027 installation guide options 1 and 2) is out of date due to changes to the linux kernel in 2013 (https://github.com/torvalds/linux/commit/e17c1aa2e1). These will presumably affect all forms of linux. Various advice on the internet forums regarding how to amend the driver info correctly do not work, for me at least.

If anyone has made changes such that an axe027 generates the /dev/ttyUSB0 device on insertion, then please advise how you did it. Meanwhile I have asked FTDI for their views, and if they respond will report back.

The command: setserial -a /dev/ttyUSB* will list what is there, if anything.
 

geoff07

Senior Member
Thanks for that. However, recent changes to the linux kernel have made the standard solution non-functional (see the torvalds ref in one of my posts). I now do have a fix and will report it under its own thread on this forum.
 

premelec

Senior Member
IMHO it would be a good idea to put many of these last posts under a relevant heading in this forum... moderators... please...
 

SteveDee

Senior Member
...recent changes to the linux kernel have made the standard solution non-functional...
Hi geoff07, I'm a little confused, as my post shows the solution to the 2013 problem.

I've just tried it again on 2 Linux systems and it still works on both. The newest one is Ubuntu with the Mate desktop, running kernel 4.8.0-34-generic

I don't have Wine, but the solution gives me: /dev/ttyUSB0 which I think is all you are looking for.
 

stan74

Senior Member
pe5 on a rpi with mate for dedicated diy people..you got to be to use linux. I tried cinnamon mate,think it was called that,on rpi,kodi didn't work so erased the sd card. most linux os look cool nowadays but you still do every thing in a terminal.Like dos on steroids.Yes I know,linux is for real users,not normal people :) answers on a postcard to linus torvalds,the bbc,Finway.
 

geoff07

Senior Member
SteveDee: Just saw your post. You are lucky, as it didn't work for me, and the Torvalds ref (above) explains why. Curious. It does work now I have converted an AXE027 to an ftdi id number using the RevEd utility. There is another post somewhere where I set out exactly what I had to do.

Stan74: I agree, I wouldn't want to run Linux (or anything) on an RPi, far too much like hard work and far too slow (though I can, as I have one that someone gave me). Linux does indeed have a command prompt as Windows used to. But most people only use that for special purposes. The rest of the time we the wimp interface just like most operating systems, and is much easier to use than Win10 for example. Plus it is free, and you don't have to buy the same stuff over again every couple of years. Oh, and it comes with 35,000 applications including most things you might need. And they are free too. If you must run Windows programs you can use Wine or just run Windows under Virtualbox. And the only bit of that you have to pay for is Windows. And if you have the skills and time you can contribute to development and help others too. My wife, who is a classic technophobe, uses Ubuntu.
 

stan74

Senior Member
Real linux users don't even load the gui. They write their own bash scripts to do everything. I bought a RPI touch screen,not official rpi but ebay £12. 2 options flash sd card with jessie and drivers installed which works, or build the drivers and then the touch drivers into existing jessie. Totally hieroglyphics, makes assembler look simple, cut and paste because it's all gibberish to me. The screen works but you can't see the bottom of the terminal even. Just novelty value really but I got the pinout data so can use it for something else.
Yes, the gui can open an app but EVERYTHING is done in the terminal, which by the way isn't like a normal editor. It's like the marmite advert.
 

hippy

Technical Support
Staff member
Take a look at my post, about half way down this page: http://captainbodgit.blogspot.co.uk/2014/12/swinging-picaxe-on-linux.html
...which might be what you are looking for.
I've just tried it again on 2 Linux systems and it still works on both. The newest one is Ubuntu with the Mate desktop, running kernel 4.8.0-34-generic
On some systems it may be necessary to use "sudo adduser ubuntu dialout" to make the user part of the "dialout" group to have permission to use the port; replace "ubuntu" with your username.

You may have to logout and login, or reboot, for the "adduser" to take effect.

Using Ubuntu 14.04 (32-bit) and 16.04 (64-bit) running from a Live-DVD I had to do both to get the port to work with Visual Studio Code with PICAXE extensions, but otherwise your instructions worked for me using a standard AXE027 with the Rev-Ed VID/PID.
 

SteveDee

Senior Member
On some systems it may be necessary to use "sudo adduser ubuntu dialout" to make the user part of the "dialout" group....
Thanks for the clarification hippy.

Bootable Linux DVDs and memory sticks are so useful and easy to use, all teckies should carry them!
 

stan74

Senior Member
geoff07. Pi's come with linux and it works fine. I 1st used ubuntu v4.? on a 486.They sent me a cd from Holland. I installed wine on a later pc with ubuntu and could run win apps from the file browser and thought that was normal. I didn't twig it was emulating it.
Freebasic for rpi opens it up for peeps like moi who can't do python.
 
Top