MacBook Pro and Picaxe 18m2 programming issues

jensmith25

Senior Member
This might be a bit of an unusual one but I have a macBook Pro and so use the MacAxe software and have no problems at all with programming the 08m2 chips.

With the 18m2 I quite often have to try several times to get it to programme, despite it working fine just before and it's also associated with either the USB ports stopping working after a programming/testing session, or it fails to recognise the USB port and I have to use my other port or if both have failed, reboot my mac and start again.

This is getting pretty frustrating and I wondered if anyone else had had the same problem or knew what the cause might be.
 

mikeyBoo

Senior Member
hi jensmith25,
I also have a Macbook Pro, but I use Parallels software & run all the Picaxe stuff on a Win7 virtual machine with no problems. The cool thing about the Mac w. Parallels is you can work in Windows, Linux & MacOS (as well as Android Chrome etc.) all at the same time. You simply do a 3 finger swipe to go between the different OSs & the clipboard is shared between all (meaning you can paste images & text between them). I split my hard drive into 2 partitions where the D drive (Windows term) is used for all common stuff (Picaxe, Libre docs, drawings, etc.) so operating systems can come & go without losing anything.
The Mac side is what I prefer for the web, but I need Windows for CorelDraw (nothing even close on the Mac side) & the Linux OS is nice for working with the Pi, Beaglebone, etc.
Maybe not the answer you wanted, but something to consider. The Mac would need a minimum 8gB of Ram for Parallels (ideally 16gB).
 

tmfkam

Senior Member
I use my iMac for programming in PicAxe, I've had no problems programming 08M2, 14M2 and 28X2 chips using AxePad. I've not tried any 18M2 chips.

For running the Windows version of the programming editor, I either use WINE (for PE5) or VirtualBox for a full Windows installation. I stopped using Parallels when they kept asking for payment to upgrade from a version that was broken by their own updates. VirtualBox is free, but you still need a valid (paid for) Windows licence. WINE runs Windows programs without the need for any Windows code (or licence) though I struggle with USB support for it.
 

jensmith25

Senior Member
I use VirtualBox and run Windows 7 on it for some software but I'm happy using the MacAxe software in general as it's quicker to use my mac than always be going into VirtualBox.

It's the fact something is disabling the USB ports that's the problem and that the 18M2 seems so fickle when programming it compared to the other chips.
 

hippy

Technical Support
Staff member
There is no reason we can think of as to why an 18M2 should be more fickle than any other PICAXE.

When you cannot program the 18M2 what error messages do you get ? How do you know the USB ports have stopped working ?
 

jensmith25

Senior Member
There is no reason we can think of as to why an 18M2 should be more fickle than any other PICAXE.

When you cannot program the 18M2 what error messages do you get ? How do you know the USB ports have stopped working ?
Hi Hippy,

Just the standard error message saying it can't connect to the chip. I can't remember the exact wording.

I know the USB port has stopped working because I get the error message that there is no connection to the USB port and when I go into options to "find the USB cable" it says it doesn't exist.
If I then SWAP to my 2nd USB port and "find the USB cable" it will find it and I can then download the programme but if I subsequently take out the USB cable and try again later or on another day the USB post might have also stopped working. Trying the 1st port still results in nothing and I have to reboot my laptop to get them both working again.
 

hippy

Technical Support
Staff member
I know the USB port has stopped working because I get the error message that there is no connection to the USB port and when I go into options to "find the USB cable" it says it doesn't exist.
That is odd because MacAXEpad simply invokes an "ls /dev/tty.usbserial-*" to look for the cable and parses the result. If it does not receive a result that would seem to indicate that it is the Mac which is losing the port.

Maybe try a manual "ls /dev/tty.usbserial-*" at a command prompt to see what that command returns.
 

jensmith25

Senior Member
That is odd because MacAXEpad simply invokes an "ls /dev/tty.usbserial-*" to look for the cable and parses the result. If it does not receive a result that would seem to indicate that it is the Mac which is losing the port.

Maybe try a manual "ls /dev/tty.usbserial-*" at a command prompt to see what that command returns.
I get "no such command or directory"

I know macs can have issues with losing ports but this seems to happen a lot when downloading to Picaxe and in particular the 18m2 chip on the low power project board. I've not had problems with other chips.
 
Last edited:

grim_reaper

Senior Member
Are you drawing a lot of current through the USB connection? Or just the standard 3.5mm jack to the PICAXE?

On some hardware (it's been many years...) the USB controllers will stop/disable the entire port if more than the maximum allowed current is attempted to be drawn through it.
That fits your symptom that rebooting fixes the ports.
 

jensmith25

Senior Member
What would be considered "a lot"?

It's just a board with LEDs on so no motors or any high current devices.

It's not an immediate stop/disable. It only happens after the USB cable has been removed - when I go to try again, it's stopped working.
 

hippy

Technical Support
Staff member
Are you drawing a lot of current through the USB connection? Or just the standard 3.5mm jack to the PICAXE?
If the board is powered by batteries or an external PSU, not powered from the USB port, then there should be no excessive power draw through the AXE027 or USB port.

Can you confirm you are using an AXE027 or something else ?

It's not an immediate stop/disable. It only happens after the USB cable has been removed - when I go to try again, it's stopped working.
Perhaps you need to detail exactly what the situation, sequence of actions and exact error messages are.

It could be there is more than one problem; "hardware not found" which may be a result of the program running within the 18M2, requiring a Hard Reset to fix that.

Unplugging the AXE027 and reconnecting that may be causing some other issue, perhaps if the 18M2 is sending data or executing a DEBUG command. Macs may exhibit something similar to when Windows sometimes detects an active serial cable as a mouse or pointing device.
 

jensmith25

Senior Member
If the board is powered by batteries or an external PSU, not powered from the USB port, then there should be no excessive power draw through the AXE027 or USB port.

Can you confirm you are using an AXE027 or something else ?



Perhaps you need to detail exactly what the situation, sequence of actions and exact error messages are.

It could be there is more than one problem; "hardware not found" which may be a result of the program running within the 18M2, requiring a Hard Reset to fix that.

Unplugging the AXE027 and reconnecting that may be causing some other issue, perhaps if the 18M2 is sending data or executing a DEBUG command. Macs may exhibit something similar to when Windows sometimes detects an active serial cable as a mouse or pointing device.
It is the AXE027 standard cable. Powered by battery - 4.5v 3 x AAA's in general.

This current board was IR and did have a debug in it so thats' a possibility. It often is IR boards actually but not always with a debug command in the code.

Assuming it is some sort of communication between the mac and PCB I assume switching off the power to the Picaxe would stop this? I can certainly make sure I try that next time.
 

hippy

Technical Support
Staff member
This current board was IR and did have a debug in it so thats' a possibility. It often is IR boards actually but not always with a debug command in the code.
IR receiving code will block unless it has an explicit timeout specified. That causes it to ignore download initiations, can cause "hardware not found" errors on download and require a Hard Reset to accept downloads.

If the 18M2's are used with IR but the others are not, that could explain why the 18M2's seem to be more finicky. It is not so much the chip but the type of programs being run on the chip.
 

jensmith25

Senior Member
IR receiving code will block unless it has an explicit timeout specified. That causes it to ignore download initiations, can cause "hardware not found" errors on download and require a Hard Reset to accept downloads.

If the 18M2's are used with IR but the others are not, that could explain why the 18M2's seem to be more finicky. It is not so much the chip but the type of programs being run on the chip.
Ah.. thanks hippy. That would explain some of it then. I do have timeouts specified in the code but that certainly fits the experience I'm having as a hard reset does or just keep trying until it works, sorts it, in the case of the "hardware not found" errors.
 

grim_reaper

Senior Member
Glad hippy pointed you in the right direction.

What would be considered "a lot"?

It's just a board with LEDs on so no motors or any high current devices.
For the record, "a lot" is 100mA in low power mode and 500mA in high power mode. So, if you were powering the circuit from the USB port and NOT from batteries, then it's possible that the circuit could be drawing 100mA (5x 20mA LEDs plus the PICAXE itself could tip it over 100mA in total).

I'm sure someone with more experience could explain the likelihood in this situation of accidently not connecting the batteries and somehow phantom-powering the circuit from the USB connection!!
 
Top