Search results

  1. A

    Any PIC/SFR Experts?

    I2Csetup says: I can't find anything on setting the SSPADD register in the Microchip datasheet. The PICAXE values loaded for 'mode' are: SLOW 167,147,137 for 16M, 8M and 4M FAST 9, 4, 3 for 16M, 8M and 4M. I need to try to get down to a 10khz rate to feed a particularly nasty part that...
  2. A

    Any experience of GPS6MV1?

    I just got one of these. I was planning to start by using the GPS010 sample code - but I'm not sure how compatible it is. It uses a uBLOX 6M module, which seems to be similar to the GPS010. It has a 3.3V regulator allowing Vcc to be 3v to 5v, and an EEPROM for storing data I think. I've done a...
  3. A

    20M2 Loop Speed slower than expected

    I wrote some code to generate test signals, using the 'rule of thumb' 250uS per op - but it ran much slower than I expected. Breaking the code down to understand the bottleneck, I found that an 'empty' FOR/NEXT loop takes 1.6mS! Are there any techniques to 'loop' faster than this? Switched to...
  4. A

    PWMOUT and 4bit LCD Interface on same Port?

    Again I'm trying to do the unnatural! I use essentially Hippys 4bit LCD routines on pins B.2 to B.7 on the 20M2. Works well. There is a note in the archive that explains how to use B.0 and B.1 as outputs at the same time. I've used this method for simple outputs, again works well. However...
  5. A

    PWMOUT on 20M2 Off Frequency

    Once again I'm stuck with the simplest possible problem. (The hard ones I can usually fix) I need to generate a 8Khz square wave to test a piece of equipment. No problem, I thought! Used the PWM wizard, and got: #picaxe 20M2 #no_data pwmout B.1, 124, 250 Run it - nice square wave...
  6. A

    Splitting Long Lines

    "Added _\n (whitespace-underscore-newline) as line continuation for splitting long lines" I tried this in PE 5.5.0 but get Error: Unknown symbol - _ ?
  7. A

    RS232 download cable doesn't see 20M2

    I've set up a basic 20M2 breadboard to use a 'real' com port. I used the enhanced download circuit with the schottky clamp. (good practice :) ). 3 fresh AAs in battery pack, no connections to any pins other than 1,2,19 and 20. However all attempts to download a program have failed with...
  8. A

    Programming PICs - I need a favour

    I've need to burn a hex file into 3 28pin PICs, not PICAXES, but used for a PICAXE project. This is probably a one off deal and I really don't want the hassle of buying a pickit2, figuring out how to use it, installing software etc - just to do these 3. If there's a US based member that...
  9. A

    mS timer using a 20M2?

    I have need to measure a pin delay of a couple of seconds with a 20m2. I need mS resolution but not mS accuracy. If I had an X2 I could use timer3, but I don't - so how do I do it? I tried using a pause statement, terminated by an interrupt. But I have found no way of reading the remaining...
  10. A

    Extending M2 named variables

    Inspired by Rays Blog http://www.picaxeforum.co.uk/entry.php?36-Extending-PICAXE-named-variables-by-300-or-more! I have written a couple of small subroutines to facilitate Bank Switching on M2s. They use no 'normal' variables at all.... They are demonstrated in the attached variation of Rays...
  11. A

    Reasonably Optimised Sin and Cos Functions for Picaxe

    I've recently mapped my 1990s vintage HC11 sin/cos approximation over to Picaxe 20M2 and figured it may be of interest. I used a combination of series expansions, Chebyshev polynomials and a bit of fine tuning. The code is about 115 bytes and gives 3+ significant figures over most of the...
  12. A

    Maintaining and Reusing Code

    Like others before I'm running into the problem of reusing code and keeping track of variables in biggish programs. There's a lot of very good info in http://www.picaxeforum.co.uk/showthread.php?9299-Writing-Maintainable-Picaxe-Code&highlight=modular and I'm using several of the techniques in...
  13. A

    Text Strings give Syntax Error

    From Manual 2 - pg 6: PE seems to accept only single characters? z2 = "1" is accepted, z2 has value $0031 z2 = "10" gives syntax error...
  14. A

    Unary Minus Supported?

    As a result of a typing mishit (!) while entering code I found that w1 = -w1 is accepted by the simulator, and gives the expected 2s Comp result. ie w1=65535, then -w1 = 1. w1 = -1234 is also accepted. Can't find this in the docs, and in fact I think I saw somewhere that it was not allowed?
  15. A

    Maximum Number of Variables for SERIN, and PE line breaks?

    I need to receive a string of ASCII data from a GPS using serin in the format: What is the maximum number of variables that can be specified in one statement? And how do I break the line up into multiple lines in the Editor. I don't see a 'line continuation' character
  16. A

    Runtime Error '6'

    I simulate the following simple test: When I go to the MEMORY window, select SFR I get "Run-time error '6': Overflow" IF the 'HEX' box is checked. Clicking on 'OK' closes PE. If HEX is not checked, the data is displayed - but clicking it gives the error.
  17. A

    Expressing X/Y as a Percentage

    I'm converting some code over to Picaxe, and need to express the ratio of two unsigned 16 bit integers as a percentage in the form pp.p%. The original 32 bit code was simple: A = 1000 * x / y ' Given x<=Y. Returns 0 - 1000 for all values. ie 3/4 = 750; 45000/60000 = 750. I just can't...
Top