PICAXE Questions & Answers

Part 5 - Known Bugs and Other Problems



No product is 100% perfect, and the PICAXE is no exception.



Part 1 - Common Questions

Part 2 - Software Issues

Part 3 - Hardware Issues

Part 4 - Miscellaneous and Esoteric Issues

Part 5 - Known Bugs and Other Problems


Potential to damage attached hardware

The following PICAXE's can potentially damage attached hardware ...

    PICAXE-08 :  Redefinable I/O lines
    PICAXE-08M :  Redefinable I/O lines
    PICAXE-18X :  Keyboard Interface
    PICAXE-28X :  Redefinable I/O lines, Keyboard and I2C interfaces, PWM
    PICAXE-40X :  Redefinable I/O lines, Keyboard and I2C interfaces, PWM

The following PICAXE's do not have features which can potentially damage attached hardware ...

    PICAXE-18
    PICAXE-18A
    PICAXE-28
    PICAXE-28A

Details of problem

Any PICAXE which can have an Input Pin made into an Output Pin has the potential to cause irreparable damage to attached hardware and itself.

Although no one would normally set out to deliberately destroy hardware which is attached to a PICAXE, accidentally making an Input Pin into an Output can be done through programming error. While this can be done explicitly, using some of the PICAXE commands can automatically turn an Input Pin into an Output Pin which may not be expected - The prime cases are those which deal with the Keyboard and I2C interfaces and PWMOUT.

While programmers will often go to extremes to make sure that their program will not cause any adverse effects on the hardware with which it operates, they have no control over what someone else's program may do in relation to their own hardware. This is a potentially serious problem as a PICAXE will start executing its code regardless of which hardware it is in and without any knowledge of the potential damage which may be done - if the previously downloaded program tells the PICAXE to turn an Input Pin into an Output Pin then it will do so.

Workaround

There are no workarounds for the problem although the issues can be mitigated by taking appropriate care in the design and coding of your programs and in the design and wiring of your hardware, and by making sure that you always erase the PICAXE program memory before putting it in a hardware configuration that may not be the same as the one it was removed from.

It is recommended that any pin which can be either an Input or an Output should be buffered through a 'current-limiting resistor' or 'blocking diode' to external hardware but the means to do that and the appropriateness of such a scheme is beyond the scope of this document.


I2C Commands Don't Work With Some I2C Devices

The in-built commands for controlling I2C devices cannot control all I2C devices.

Details of problem

As Peter H Anderson has determined, the in-built commands for controlling I2C do not send I2C data in a format which is suitable for controlling all I2C devices.

The I2CREAD and I2CWRITE ( plus READI2C and WRITEI2C ) commands send the following information over the I2C bus to perform their function ...

    1) I2C Device ID ( Address ) - Set using I2CSLAVE command
    2) Memory Location
    3) Data to Read or Write

Devices such as the Maxim MAX127 Digital to Analogue converter need to receive an I2C packet which has the following format to work ...

    1) I2C Device ID ( Address )
    2) Command

Unfortunately none of the PICAXE's in-built I2C commands can send an I2C packet in this format.

Workaround

There is no workaround which uses the PICAXE in-built I2C commands, but it would be possible to control an I2C device using 'bit-banged' I2C routines, however, it may require adiitional external hardware to interface to the I2C bus as not all PICAXE's have bi-directional I/O lines, or those which can operate exactly as the I2C control lines do.


Unwanted Debug Window

When a program is downloaded into a PICAXE, the Programming Editor may bring up a Debug Window even if no DEBUG commands have been used in the program.

Details of problem

The Programming Editor calls an external module to compile a program for a specific variant of a PICAXE and the resultant obect code which is to be downloaded is returned in a temporary file. The Programming Editor has no idea if the object code contains a DEBUG statement or not and has to parse the object code file to see if it contains a DEBUG statement; if it does the Debug Window is presented after the program has been downloaded, otherwise the normal 'Download Complete' or Serial Terminal Window is presented, depending upon the Options set.

Although it is entirely possible to accurately 'disassemble' the object code created for a PICAXE, discriminating between command tokens and command argument tokens ( such as variables and data ), a flaw in the Programming Editor results in some sequences found in the object code being misinterpreted as DEBUG commands when none are actually present. This leads to the unwanted Debug Window appearing.

Workaround

Because it is not clear how the Programming Editor does its object code parsing, it is not easy to tell when it will misinterpret object code as containing DEBUG commands. The flaw is not commonly seen, but appears to be more likely with long strings and lists of data such as with BRANCH, LOOKUP, LOOKDOWN, SERIN, SEROUT, SERTXD, SOUND, and TUNE commands.

The flaw also appears to be 'position dependant'; download behaviour may be as expected until some other code is added to a program, and likewise, it may return to normal as more code is added.

This bug is more an annoyance than anything else, as it does not affect compilation, downloading nor program execution. It is therefore recommended that the problem is ignored as best it can be. Avoiding the unwanted Debug Window will be a matter of trial and error; re-ordering command argument values may be successful in some cases, but not always, and not necessarily possible.

There is no guaranteed workround for the problem, and the faulty behaviour can potentially re-appear at any time. Efforts involved in modifying program code to prevent the flawed behaviour of the Programming Editor may well outweigh the inconvenience of living with it.


Analogue Readings affected by Download Cable

All PICAXE's which have an 8-bit or 10-bit analogue input resolution are believed to be potentially affected by this problem.

Details of problem

When using the READADC and READADC10 commands to read an analogue input, the value read can be different when the Download Cable is connected and when it is removed.

Although the exact details of the underlying problem have not been discovered, it appears that the negative voltage which is usually present on a PC's serial output line ( +15V/-15V or +12V/-12V ) is having an adverse effect with the Analogue to Digital Convertor's internal voltage reference circuit.

With the Convertor's voltage reference being affected, the analogue readings taken will give differing results when the Download Cable is connected ( negative voltage present ) and when removed ( no negative voltage ).

Workaround

Many thanks go to Bob Raynor for pointing us to a solution for the PICAXE which has been reported to work perfectly by many people who were having problems.

The solution is to connect a Schottky Diode between the Serial In leg of the PICAXE and 0V.

The diode used must be a low voltage-drop Schottkly device which will clamp the voltage at the Serial In leg to -0.3V at which voltage there appears to be no noticeable affect on the internal voltage reference circuit.

Power diodes such as the 1N4001 and 1N4004, and signal diodes such as the 1N4148, will not give the necessary clamping voltage and cannot be used. Schottky diodes are generally available at the same price as power and signal diodes and are fairly readily available for suppliers.

   .---.
+V | O |---------------------------------------------------.---------- +V
AI | O |-------------.                                     |
0V | O |------.      |                             .-------^-------.
   `---'      |      |                             |               |
  Analogue    |      `-----------------------------| Analogue In   |
              |                                    |               |
   .----.     |                                    |               |
1  | O  |-----|------------------------------------| Serial Out    |
   |   ||     |           .------.                 |               |
2  | O ||-----|------.----|      |-------.---------| Serial In     |
   |   ||     |      |    `------'       |         |               |
3  | O  |-----{     _|_      22K       __|__       `-------.-------'
   `----'     |    |   |                / \                |
  Download    |    |   | 10K           /   \  Schottky     |
              |    |   |               --.--    Diode      |
              |    `-.-'                 |                 |
              |      |                   |                 |
            --^------^-------------------^-----------------^---------- 0V

It would appear possible to use a standard signal diode in place of the Schottky Diode by placing it parallel across the 10K resistor. This may work in some circumstances, but the diode will present itself as almost a short circuit to negative voltages from the Serial Port in the absence of any current limiting resistor. It is therefore recommended that only the above solution using a Schottky Diode is used.

An alternative solution, identified by 'BeanieBots', is to place a regular signal diode, such as a 1N4148, in series with the serial input line ...

   .---.
+V | O |---------------------------------------------------.---------- +V
AI | O |-----------.                                       |
0V | O |------.    |                               .-------^-------.
   `---'      |    |                               |               |
  Analogue    |    `-------------------------------| Analogue In   |
              |                                    |               |
   .----.     |    .----------                     |               |
1  | O  |-----|----'          `--------------------| Serial Out    |
   |   ||     |        |\ |            .------.    |               |
2  | O ||-----|--------| >|-------.----|      |----| Serial In     |
   |   ||     |        |/ |       |    `------'    |               |
3  | O  |-----{       1N4148     _|_      22K      `-------.-------'
   `----'     |                 |   |                      |
  Download    |                 |   | 10K                  |
              |                 |   |                      |
              |                 `-.-'                      |
              |                   |                        |
            --^-------------------^------------------------^---------- 0V

This has proved to be successful for PC's whose serial ports output -12V/+12V signals, but has not been tested with Laptops which often only output 0V/+5V where the voltage drop caused by the diode may prove to be problematic in such cases.


Unreliable DS18B20 Temperature Sensor behaviour

Some users of the Dallas DS18B20 Temperature Sensor have reported that the sensor returns an incorrect temperature when operating near or below 20°C ( 68°F ) when the READTEMP or READTEMP12 commands are used.

The problem appears to only affects a minority of users, often appears only intermittently, but has been confirmed by Revolution Education Limited ( May 2004 ) to be a potential problem with all variants of PICAXE's.

The fiollowing PICAXE devices should not be susceptible to incorrect temperature readings ...

    PICAXE-08M :  Firmware Version 9.0 and later
    PICAXE-18A :  Firmware Version 5.4 and later
    PICAXE-18X :  Firmware Version 8.5 and later
    PICAXE-28A :  Firmware Version 6.4 and later
    PICAXE-28X :  Firmware Version 7.6 and later
    PICAXE-40X :  Firmware Version 7.6 and later

Details of problem

When the temperature read by the DS18B20 is near or below 20°C, the raw temperature value obtained using a READTEMP command is often '129', which converts to either 129°C, or with 'negative temperature' correction applied, -1°C. Other incorrect values can also be returned.

The underlying cause of the problem appears to be a timing issue with the DS18B20, but shortly after the initial problem was identified, the manufacturer of the DS18B20 put the device on "engineering hold as it is not yielding correctly".

Further research by PICAXE Forum Members and others revealed that there is a power-on problem identified by Dallas Semiconductor on DS18B20 devices manufactured with a 'B7 die', but that information has not been widely circulated, and could not be found on the Dallas Semiconductor site, nor that of Maxim, its parent company. The information can however be found as AN247 - DS18x20 EEPROM Corruption Issue, which reveals a power-on problem which can lead to the corruption of the device's internal configuration settings. AN247 makes for very depressing reading, indicating that the device can be permanently corrupted and give readings that are out by 60°C.

Workaround

Revolution Education Limited have implemented a Firmware change which will make DS18B20 operation reliable, but there is no proven workround for those using existing components which have a problem. The only workaround if the problem arises is to utilise different PICAXE and DS18B20 cominations until the problem no longer manifests itself. It is strongly recommended that devices using the B7 die are not used.

It is also important to ensure that the DS18B20 is used in accordance with its datasheet instructions, paying close attention to its operating voltage, and length of interfacing cables. Failure to comply with these requirements may result in unreliable or incorrect operation, although designs have successfully used DS18B20 temperature sensors at a distance of over 200 feet using Cat 5 cable.

Recommendation

As of May 2004, Revolution Education Limited strongly recommend that PICAXE users do not design or build systems which use the DS18B20 or DS1822.

Due to the B7 die problem, there is a shortage of those devices, and they will not be available for many months, and unlikely to be available before Autumn 2004.


Faint Serial LCD Module Display ( AXE033 )

When used with a power supply of 5V or less, the Serial LCD Module display may not show characters or shows characters only faintly.

Details of problem

The Serial LCD Module has a diode included through which it draws its power; this diode will drop the incoming voltage by around 0.7V. The diode appears to have been included to allow the display to work from 6V, dropping the voltage that is provided to the LCD and controller to the nominal 5V that it is designed to operate with.

When the Serial LCD Module is provided with 5V or less, the voltage drop across the diode causes the display to receive a voltage which may be too low to allow the display to show fully or properly.

Workaround

The voltage dropping diode on the Serial LCD Module can be removed and replaced by a link ( or shorted out ) to increase the voltage provided to the display, but ensure that no more than 5V is supplied to the display or electronics. It will be necessary to trace the tracking on the serial LCD Module circuit board to determine which diode needs to be shorted or replaced.

It is also recommended that the Serial LCD Module is run from a supply which is as close to 5V as possible, as it has been reported that even a small reduction of supply voltage ( even 4.5V ) can cause problems.


Errors with multiple READADC on the PICAXE-08M

This problem only affects the PICAXE-08M Firmware 9.0 and only when reading more than one analogue input pin.

Details of problem

A program which attempts to read multiple READADC or READADC commands on different pins may return incorrect results ...

        READADC 1,b1
        READADC 2,b2     ' Result in b2 may be incorrect

Workaround

To obtain correct results, a dummy READADC should be used whenever a different Analogue Input Pin is to be read from the one previous ...

        READADC 1,b1
        READADC 2,b2     ' Dummy read of Analogue Pin 2
        READADC 2,b2     ' Result in b2 will be correct


Unexpected SERTXD and SEROUT interaction

The following PICAXE's are affected by the SERTXD and SEROUT interaction problem ...

    PICAXE-18X :  ?
    PICAXE-28X :  ?
    PICAXE-40X :  ?

Details of problem

Data transmitted using SEROUT which should be sent to the pin specified in the SEROUT command, and at the baud rate specified, is actually sent through the Serial Out line at 4800 baud when the SEROUT line is immediately preceded by a SERTXD command ...

        SERTXD ("TXD")
        SEROUT 1,N600,("OUT")

This will actually send "TXDOUT" through the Serial Out line at 4800 baud. This can be observed using the Programming Editor Terminal function with the baud rate set to 4800. It is not clear what is sent to the pin specified by the SEROUT command.

Workaround

From preliminary, but non-exhaustive testing, it appears that the problem may be erradicated by placing a "PAUSE 1" statement between consecutive SERTXD and SEROUT commands, although what is sent out to the pin specified by the SEROUT command, and at what baud rate, has not been checked ...

        SERTXD ("TXD")
        PAUSE 1
        SEROUT 1,N600,("OUT")


Lost Source Files

The Programming Editor, Versions 2.3.5 ( and possibly earlier ) through 4.1.2, can cause the contents of source files to be altered or emptied when files are saved.

The contents of a source file can be lost, corrupted or changed whenever the file has been opened, for editting, solely for viewing, or even if opened by mistake.

Due to the nature of the bug, you may not be aware that any source code has been lost until you use the source code file sometime later, and the bug often gives the impression of "user error"; that you forgot to save a file, or accidentally saved a file as the wrong filename.

Details of problem

There is a bug in the Programming Editor file editing handler which causes the wrong 'edit pane' to be written to disk when a file is saved. This can result with a file being saved with the contents of another file being edited or the file may be emptied entirely; all original source code will be lost unless you have a backup copy.

It is not possible to predict what problem may occur, but the following sequence will demonstrate the existance of the bug in Programming Editor 4.1.2 and earlier ...

  1. Open Programming Editor, leave the empty edit pane open, and open another file which you don't mind losing the contents of ( File -> Open ).

  2. Edit that file.

    You should now have two overlapping edit panes ...

  3. Accidentally [sic] click on the "Untitled:1" edit pane's 'header bar' which brings it to the front.

  4. Close the Programming Editor using File -> Exit.

  5. To the "Text has changed. Save file ?" popup for "untitled:1" answer No - It hasn't changed anyway !

  6. To the "Text has changed. Save file ?" popup for the file you did edit, answer Yes, after all you did just edit it, and want to keep the changes made.

The file you just edited is emptied, and contains nothing when re-opoened.

Workaround

Only ever work with one edit pane open in the Progranmming Editor at a time; close all "Untitled" edit panes at the earliest opportunity, and do not open multiple source files at the same time.

Be very careful when prompted with the "Text has changed. Save file ?" pop-up, and do not casually select "Yes" if the file has not changed.

Keep regular backups of your source files.


Incorrectly described &/ and |/ Operators

In some PICAXE documentation the &/ ( "AND NOT" ) and |/ ( "OR NOT" ) operators have been incorrectly described as being "NAND" and "NOR" operators respectively; this is not correct.

Details of problem

With 'b2 = b1 &/ b0', the value in 'b0' is inverted before it is ANDed with the value in 'b1' to give a result in 'b2', and likewise for |/ the value in 'b0' is inverted before ORing with the value in 'b1'. This gives an entirely different result to performing an AND or OR and then inverting the result which is the correct implementation of NAND and NOR.

Workaround

If you wish to use a NAND or NOR operator, the following code should be used ...

    b2 = b1 NAND b0     b2 = b1 & b0 ^ $FF    or  b2 = b0 & b1 ^ $FF
    b2 = b1 NOR b0      b2 = b1 | b0 ^ $FF    or  b2 = b0 | b1 ^ $FF

    w2 = w1 NAND w0     w2 = w1 & w0 ^ $FFFF  or  w2 = w0 & w1 ^ $FFFF
    w2 = w1 NOR w0      w2 = w1 | w0 ^ $FFFF  or  w2 = w0 | w1 ^ $FFFF


Faulty MIN operator

The following PICAXE's are affected by the MIN operator problem ...

    PICAXE-08 :  Firmware Version 4.1 and below
    PICAXE-18 :  Firmware Version 2.4 and below
    PICAXE-28 :  Firmware Version 3.4 and below

Details of problem

The MIN operator does not perform as expected.

Workaround

If you need to limit the minimum value of a variable, the code required can be used instead ...

        b0 = b1 MIN b2

becomes ...

    b0IsB1Minb2:
        b0 = b1
        if b0 >= b2 THEN b0limitedTob2
        b0 = b2
    b0limitedTob2:


Incorrect LCD Wiring Instructions

There is an error in the instructions on how to connect an LCD to a PICAXE in the Electronics Interfacing Circuits datasheet provided with the Programming Editor software version 4.0.10 and earlier.

LCD's which are wired as instructed will not work with the example code given in the datasheet, nor with my own LCD Interfacing software.

Details of problem

On Pages 34 and 37, the instructions on connecting an LCD to a PICAXE indicate that DB4 of the LCD is connected to Output Pin 7 of the PICAXE, and correspondingly through to DB7 being connected to Output Pin 4.

This is not correct. The connections described result in a 'swapped nibble' which will prevent the LCD from working as expected. The correct connections should be DB4 to Output Pin 4 through to DB7 to Output Pin 7.

Workaround

Re-wire the LCD to PICAXE connections so that DB4 from the LCD connects to Output Pin 4 of the PICAXE, DB5 connects to Output Pin 5, DB6 connects to Output Pin 6 and DB7 connects to Output Pin 7.


Unreliable Serial LCD Module ( AXE033 )

Some users of early versions of the Serial LCD Module ( AXE033 ) may experience problems when it is connected to a PICAXE-08, 08M, 18, 18A or 18X. The usual problem is a failure to display characters, a corrupted display or the wrong characters are displayed. Numeric characters may often display correctly while others are corrupted.

The problem only affects a minority of users, and anyone who purchased a Serial LCD Module since the end of 2003 should have received a version with the latest Firmware included.

Details of problem

Because the microcontroller within the Serial LCD Module is not crystal controlled, and nor is the PICAXE controlling it, the operating speed of the serial interface may drift out of specification resulting in the Serial LCD Module losing data or receiving corrupted data. Consequently, what was sent by the PICAXE may be misinterpreted by the Serial LCD Module, which may prevent the intended display from appearing.

Workaround

Later versions of the Serial LCD Module include an option which allows the Serial LCD Module to be adjusted for use with serial interfaces that are out of specification, and Revolution Education Limited offers a free Firmware Upgrade for those who have older versions of the Firmware.

Full details on configuring modules using later versions of the Firmware are provided in Appendix A of the Serial LCD Module datasheet ( axe033.pdf ).

That datasheet also includes instructions on how to determine if you have an earlier or later version of Firmware and how to get your earlier Firmware upgraded.


PICAXE is a trademark of Revolution Education Ltd. These PICAXE pages are produced entirely independantly of Revolution Education Limited and may not reflect the opinion of Revolution Education Limited or its agents. The information provided is based upon and derived from information published by Revolution Education Limited, other sources of PICAXE information and the author's own experiments and prior experience. The views expressed by the author do not necessarily represent those of Revolution Education Limited or its agents. While every effort has been made to ensure that the information on these PICAXE pages is accurate and correct, the author can accept no responsibility for any errors or ommissions which do occur. The information provided is used entirely at your own risk.





Associated Articles

  The PICAXE Processors
  PICAXE News
  PICAXE Questions & Answers
  PICAXE Comparisons
  PICAXE Pinouts
  PICAXE Serial Interfacing
  PICAXE Infra-Red Interfacing
  PICAXE Wireless Interfacing
  PICAXE LCD Interfacing
  PICAXE LCD Interfacing
  A Real-Time Clock for the PICAXE-18X
  PICAXE Optimisations
  The PICAXE Birthday Box Project
  PICAXE Telephone Exchange Simulator
  The Brainf**ked PICAXE
  The PICAXE Extended Programming Interpreter
  Build Your Own Basic Stamp
  Tech Toys



Sites to Visit

  PICAXE Home Page
  Revolution Education Ltd

  Tech-Supplies Ltd



Site Navigation

  Home Page
  What's New
  Search
  Add Bookmark
  Have Your Say
  Guestbook




First published on Friday the 12th of March, 2004 at 17:20:43
Last upload was on Thursday the 16th of December, 2004 at 11:40:37