Converting variables.... the long way

Steve2381

Senior Member
Hi all

I am programming a DS1307 RTC. Its hooked up to a 14m2.
If I remember rightly, you program the RTC using hex numbers, but read them back in BCD.

I can't use BCDtoBin or any of the other pre-coded conversions, because it says they are not supported on the 14m2.

Is there a long way of converting a decimal to a hex value (for when I program it ). The clock needs to be programmed from a decimal variable.

Same goes for reading the time back. I need to convert that back to decimal.

Thanks

Edit.... just out of interest, what is the first chip up from a 14m2 that allows Unary mathmatics?
 
Last edited:

Steve2381

Senior Member
Thanks Hippy. I will try those. I can't jump up to a X1 or X2, so I will have to keep variable bashing.
I have been Googling and basically getting nowhere
 

Steve2381

Senior Member
Great.....

Any ideas what the heck has happened to my programmer in the last 30 seconds....
No Picaxe found. Now in the options box, I have 2x Axe027 programming opions next to USB 3 and USB 4 (I only have one board)... these are unavailable. And underneath that is says Communications port available on USB 4.
None of them work. Reboot... nope. Delete the Axe027 from devices and let it re-install.... nope.
Its random failing tech crap like this that makes my blood boil
 

Steve2381

Senior Member
Well I cannot see the issue with this stupid USB connection and I am off to bed.
Re-installed everything and the USB ports just won't recognise the Axe091 lead.
Looks like I will have to move the project over to an Arduino
 

hippy

Technical Support
Staff member
Not sure why it's gone wrong but it would be useful to know which PICAXE software you were using and the OS.

When removing USB devices from Device Manager you have to select Show Hidden Devices and have to set a "DEVMGR_SHOW_NONPRESENT_DEVICES" environment variable to "1" to show devices which are not plugged-in. That I believe applies to all Windows, XP upwards -

https://msdn.microsoft.com/en-us/library/windows/hardware/ff553955(v=vs.85).aspx

Doing that, then removing all AXE027 devices should get you back to a clean pre-AXE027 setup, but you may have to tweak the COM port allocated after you reinstall the AXE027 as it will usually be given a higher-up COM port number.
 

Steve2381

Senior Member
God I hate tech when it goes wrong for no apparent reason.

Windows 10. Programmer 5.5.6. Plugging in the Axe027 lead brings up communications port - not Axe027.

I will try your suggestion Hippy, as I don't really want to have to re-write the evenings work onto an Arduino.


.edit..

Well if you show hidden devices in device manager, it lists 3x Axe027's. I deleted all 3 and then plugged the lead back in.
Plugged the lead back in and it re-installed it.
It clears the bogus Axe027's from the programmers USB list, but it still lists the programming lead as communications Port - and it doesn't work.
Why would it not now see it as an Axe027 lead? There is nothing on in the Axe027 lead that could have gone is there?
 
Last edited:

Steve2381

Senior Member
OK. If you use the serial port tools, it says the Axe027 is being used elsewhere and therefore unavailable. How can that be? Even after a reboot?
It says to stop the other application using it, so that it can be used for programming.
 

westaust55

Moderator
Since I moved to Windows 10 a couple of months back (waited until I was on holidays and changed 4 PCs from Win7 Pro to Win10 in the same week).
I have no problems with the actual hardware but what I do observe is:
1. When the AXE027 is plugged into USB com3 device manager and PE report com3 as a com device present and the AXE027 is shown for Com4.
2. When the AXE027 is plugged into USB com 4 device manager and PE report the AXE027 on Com3 and a com device present on Com4.
I have to select the untitled "Comm Device" port and all works correctly.
As it is showing up this way in the Win10 device manager and needing to select as I do, it is clearly a Win10 problem and NOT a PICAXE hardware/software problem.
 

Steve2381

Senior Member
Well I deleted everything that wasn't bolted down.

Installed the new programmer version 6.0.8.6.

It worked. But..... ran a routine that included a debug statement (hate that new debug screen... its really hard to read). And it got stuck in the debug loop. How the heck do you exit the program once its debugging? (I have a feeling it was stuck).
The old one - you simply hit the cross top right.

In the end I killed the power to the 14m2 and it escaped. But, it was so laggy to use I gave up.

Time for bed
 

Technical

Technical Support
Staff member
Debug is toggled on/off by simply clicking the debug button on the code explorer. In PE6 we moved to a non-modal debug screen due to large numbers of requests for this feature (ie you can now watch debug values change and look through your code at the same time). You can also right click over the values and choose which values to display (ASCII, hex etc).

CaptureDebug.PNG
 

Steve2381

Senior Member
Thanks.
It just lagged so badly that I had to uninstall it. The Debug toggle (and everything else) was unresponsive.
Not sure what happened to the editor, it just suddenly stopped working and I have not got it fixed since.
Re-installed version 5 and that still doesn't work. Enabled hidden connections mode and deleted everything associated with Picaxe and started again... no go.
I have 2x Axe029 leads here, neither work.
Had to move the project over to an Arduino until I have time to work out what the issue is
 

albatros

New Member
Hi,

I have sometimes the same issue with the debug button.
What I'm doing then is switching of the power of the PicAxe.
In that case the (Debug) tansmission from PicAxe to the PC stops and the debug button is responding (for a on/off)

albatros
 
Top