Should I use a picaxe?

kamilan

Member
Hello,

I've got a time critical project measuring the speed of sound. I have a sine wave generator that can be triggered by a digital hi.

I have been developing a pcb board that triggers a hi when i particular frequency is detected.

Using the PICAXE-08 Chip I want to...

Setup:
PIN 1, PIN 3 as an Input
PIN 2, PIN 4 as an Output

Via Labview I want to start the program by making PIN 1 Hi.

wait 100ms

Set PIN 2 Hi to start the wave generator.

Goto a sub routine that starts an incremental counter as long as PIN 3 is lo.

PIN 3 will only go hi when the PCB picks up the the particular wave and outputs a hi.

When PIN 3 is hi, I want to go back to the Main code and apply some math to the counter value.

For example if after the math the figure is 6, go to another sub routine that will pulse PIN 4, 6 times.

Finally go the the start of the program to repeat the process.

We know that each operation occurs on 1 clock cycles. Depending on the counter sub rountine, the incremental count will also be one cycle. Meaning 6 counts at 4 Mhz is 0.000006 seconds. We can take into effect that it takes one clock to get to the routine adding one to the count.

Should I use this chip?

Any advice would be great. I don't have alot of time so I need a solution asap.

Cheers

Kamilan
 

westaust55

Moderator
Hello,

I've got a time critical project measuring the speed of sound. I have a sine wave generator that can be triggered by a digital hi.


We know that each operation occurs on 1 clock cycles. Depending on the counter sub rountine, the incremental count will also be one cycle. Meaning 6 counts at 4 Mhz is 0.000006 seconds. We can take into effect that it takes one clock to get to the routine adding one to the count.

Should I use this chip?

Any advice would be great. I don't have alot of time so I need a solution asap.

Cheers

Kamilan

I think that you are talking about the time to execute a machine code (assembler) instruction in a native PIC chip.

The PICAXE uses a PIC chip with a BASIC interpreter. THis makes execution slower and a BASIC command will take of the order of 1` millisecond, not 1 microsecond (or less).
 

kamilan

Member
Oh I see

:( Darn. I was really hoping for a quick soultion.

Is there a way of count rising edges with the picaxe? if so how fast can i count?

Cheers

Kamilan
 

westaust55

Moderator
Have a look at PICAXE manual 2. In particular the COUNT command on page 33 of the current revision.


Assuming a 50% duty cycle with the PICAXE at 4MHZ the highest frequebncy is 25kHz, with the PICAXE at 8MHz the highest frequency is 50kHz and with the PICAXE at 16MHz the highest frequency is 100kHz.
 
Last edited:

kamilan

Member
Hello,

I will have a read of the manual later today. Just to clarify its 25 kHz, 50 kHz and 100 kHz?

Thank you for the information westaust55, boriz and Mycroft2152.

Cheers

Kamilan

Will post with further updates of my progress. :)
 

tiscando

Senior Member
I see, so for a normal pic chip, each assembler command takes about a microsecond to execute, but each PICAXE BASIC command takes about 0.5 milliseconds to execute, so a picaxe chip is 50 times slower?:eek: However, how long does it take to download a PIC chip with assembler code compared to the similar PICAXE BASIC code, which does the same thing as the assembler, being downloaded onto a PICAXE chip? How long is an assembler program text on-screen compared to BASIC text on screen which does the same things? What clock frequency does a typical pic chip normally run on, and what is the highest clock frequency for pic chips? e.g. a picaxe chip normally runs on a 4mhz but the x2 parts could run up to 40mhz.
Is it worth the hassle getting PIC chips and the programmers, for demanding projects such as a brushless motor driver.
 

westaust55

Moderator
PICAXE vs PIC

You could try and format your questions better . . . .

I see, so for a normal pic chip, each assembler command takes about a microsecond to execute, but each PICAXE BASIC command takes about 0.5 milliseconds to execute, so a picaxe chip is 50 times slower? However,: ?
Some answers below but I am sure others will extend upon this . . . .

1. How long does it take to download a PIC chip with assembler code compared to the similar PICAXE BASIC code, which does the same thing as the assembler, being downloaded onto a PICAXE chip?
I am guessing here but here goes . . .
You will not be downloading via the Boot loader so speed (bytes/second) may be faster.
Efficient machine code will be smaller than the tokenized BASIC file so less time there.



2. How long is an assembler program text on-screen compared to BASIC text on screen which does the same things?
Generally longer (that is more lines of text) as one BASIC Instruction will take many machine code (assembler) instruction


3.What clock frequency does a typical pic chip normally run on, and what is the highest clock frequency for pic chips? e.g. a picaxe chip normally runs on a 4mhz but the x2 parts could run up to 40mhz
The PIC chips used for PICAXE’s form the 08M to the 40X1 are rated for frequencies from “DC to 20MHz”
However the PICAXE has a pre-defined step of speeds available from ~32KHz to 16MHz (see the PICAXE manuals)

.
4. Is it worth the hassle getting PIC chips and the programmers, for demanding projects such as a brushless motor driver.
You will/may have costs for the compiler software and programmer.
It is more complex to program in machine code until you become quite proficient in it. Once you are proficient, it can be far more flexible.



The PICAXE is intended towards the education market and when one sees the sort of question some beginners have the need for such as system is warranted. After all, BASIC is an acronym for Beginners All-purpose Symbolic Instruction Code.

If its sheer speed you want then go for the PIC and program in machine code. Then you will likely find yourself adding NOP’s (No Operation) statements and loops to slow execution down a bit for user interfaces.
 
Last edited:

BeanieBots

Moderator
Is it worth the hassle getting PIC chips and the programmers, for demanding projects such as a brushless motor driver.
Depends if you ever want to do such a project.
You won't ever be directly controlling a brushless motor with a PICAXE.
(well.. not at more than a few rpm.)
 

tiscando

Senior Member
You will not be downloading via the Boot loader so speed (bytes/second) may be faster.
Efficient machine code will be smaller than the tokenized BASIC file so less time there.
I see, so the download speed of assembler code is just the same as a PICAXE download. What's a boot loader? how does assembler download without a boot loader (does that still mean the PIC chip has to be prized out of it's breadboard circuit or socket and onto an external programmer every time a new download is to be made)?

(assembler = machine code)
 

Andrew Cowan

Senior Member
If you can be bothered to learn assembler, then a regular PIC. If you can't - then pick a slower project to do and use a PICAXE.


Assembler code to flash an LED:
Code:
;*****Set up the Constants**** 

STATUS         equ       03h                 ;Address of the STATUS register
TRISA             equ       85h                 ;Address of the tristate register for port A
PORTA           equ       05h                 ;Address of Port A
COUNT1        equ       08h                 ;First counter for our delay loops
COUNT2        equ       09h                 ;Second counter for our delay loops 

;****Set up the port**** 

                        bsf                   STATUS,5       ;Switch to Bank 1
                        movlw              00h                    ;Set the Port A pins
                        movwf              TRISA              ;to output.
                        bcf                   STATUS,5       ;Switch back to Bank 0 

;****Turn the LED on**** 

Start               movlw               02h                   ;Turn the LED on by first putting
                       movwf               PORTA            ;it into the w register and then on the port 

;****Start of the delay loop 1**** 

Loop1          decfsz              COUNT1,1       ;Subtract 1 from 255
                     goto                  Loop1              ;If COUNT is zero, carry on.
                     decfsz             COUNT2,1        ;Subtract 1 from 255
                     goto                 Loop1                ;Go back to the start of our loop. This delay counts down from 255 to 0, 255 times.

;****Delay finished, now turn the LED off**** 

                    movlw              00h                     ;Turn the LED off by first putting
                    movwf              PORTA              ;it into the w register and then on the port 

;****Add another delay**** 

Loop2        decfsz             COUNT1,1           ;This second loop keeps the
                   goto                 Loop2                   ;LED turned off long enough for
                   decfsz             COUNT2,1           ;us to see it turned off
                   goto                 Loop2                   ; 

;****Now go back to the start of the program

                   goto                 Start                  ;go back to Start and turn LED on again 

;****End of the program**** 

end                                                             ;Needed by some compilers and also just in case we miss the goto instruction.
PICAXE code to flash an LED:
Code:
Main:
High 1
wait 16
Low 1
wait 16
goto main
The first example will run much more quickly, but apart from that, they do the same thing. The PICAXE bootloader lets you download the basic program, but run something more complex (alough it is not as fast as a raw PIC).

Andrew
 
Last edited:

westaust55

Moderator
what should i use for a time critical project? another chip?


Would need to know more about the project.
1. is is secondary school or university project?
2. what degree of accuracy do you need? Probably related to Q1.
3. what medium will the sound travel through?
4. what is the length of the path over which you will be measuring?
5. Is time critical meaning high accuracy or it has to be done yesterday?
6. and other things which currently do not come to my mind


The speed of sound varies greatly depending upon the substance it is travelling through. For example:
- in air ~300m/s
- in water ~1500m/s
- in steel ~5000m/s
- beryllium ~13,000m/s

So if we assume a path distance of 10 metres then:

In a gas such as air and a distance of say the duration to travel 10 metres will be in the range 30 to 40 milliseconds.
A PICAXE could handle this – maybe with a slight/small error.

In water that duration is down to around 6ms so with other PICAXE system delays getting unlikely
In anything else – suggest forget it with a PICAXE and use a PIC instead.

Obviously if the path length is a kilometre and using interrupts, then the PICAXE delays in acting upon a signal becomes a small percentage of the total time and the error reduces plus there is a longer time so you have a chance. Then even with beryllium you have a duration of ~75ms.

However we have given you information but at the end of the day you need to define some parameters and do some of your own research and make the final decisions.
 
Last edited:

tiscando

Senior Member
I see, so machine code is a bit longer compared to picaxe code. Looks like it is about poking the SFRs to do stuff.
 

BeanieBots

Moderator
Except there's no convienient "poke" command either.
One way of thinking about machine code is to consider having only the following.

Load a memory address with data.
Get data from a memory address.
Shift the data left
Shift the data right
Add two bits of data

And that's your lot. So if you wanted to say multiply by five, you could do two shifts and an add.
All the rest of the instructions are just different addressing methods and a few other logical functions.
 

westaust55

Moderator
When you compare the PIC versus some other chips:

PIC has around 35 assembler commands (really is a Reduced Instruction Set)

A 68705P3 microcontroller had nearly 250 commands - played with them in early 1980's

and older microprocessors like the 6800, 6502 and Z80 (plain CPU without IO, timers memory etc) often had approaching 255 commands.
 
Last edited:

tiscando

Senior Member
The PICAXE manual 1 says this:
... so that each download does not have to waste time downloading this commonly required data. This makes the download time much quicker.
Someone here said that downloading efficient machine code is the same speed or faster than downloading PICAXE BeginnersASICode onto a picaxe. who's wrong, or is it conditional, e.g. the pic**c series could take longer to download than the newer pic**F flash-based series used by picaxe, suggested by www.rapidonline.com/.../PIC16FXXX-8-bit-CMOS-Flash-EEPROM-microcontrollers. When I was looking for the pics that are used by picaxe, I found versions that supersede these in FLASH memory and RAM size
...
• PICAXE-28X2 PIC18F2420 (16k flash, 768 RAM)
...
• PICAXE-40X2 PIC18F4420 (16k flash, 768 RAM)

They get superseded by:
PIC18F2520 SDIL-28 (32k FLASH, 1536 RAM)
PIC18F4520 DIL-40 (32k FLASH, 1536 RAM) :eek:

Evidence: PIC18Fxxxx-Enhanced-Flash-microcontroller - see the technical specification near the bottom (click on the 'show' button)

EDIT: could the F series be downloaded on it's running board (as with PICAXE), unlike the 'C' series, which needs to be taken off it's running board, and into a chip programmer?
 
Last edited:

BeanieBots

Moderator
Why is download speed important?
Typical download time is <10S.
This would only be an issue if you have a production line which needs to keep up with more than eight thousand units per day. A product that successful can surely justify a second PC.

If a "patience" thing, meaning you get frustrated waiting 10S for a download, then this is the wrong hobby for you. How would you cope waiting for a new PICAXE to arrive. That can take 48 hours on a bad day. That's nearly 20 thousand downloads!
 

Dippy

Moderator
Kamilan,
to your first question: for accuracy you would need to use a PIC + Assembled/Compiled code.
What you are trying to achieve is already done quite happily by those SRF00x ultrasonic modules which use a PIC.

Sadly, to your comment "I don't have alot of time so I need a solution asap."
- hard luck. Unless you buy a module like the SRF then "asap" will not be very soon.
You will have to learn how to use a harder-to-learn compiler and possibley have to buy the associated programming hardware to go with it.

There have been many comments posted which are very interesting. I'm so impressed.

Tiscando,
1. Forget C series PIC for prototyping/learning. I would suggest LF where poss.
2. Unless you have a grasp of your intended application don't get overexcited about huge RAM sizes and mines-bigger-than-yours.
3. For demanding stuff you will have to learn a harder-to-learn compiled approach.
You will NOT learn Assembler in 5 minutes.
And you will NOT be able to do complicated Assembler code in 5 months.
Even the compiled stuff (BASIC, Pascal, C) will rely on YOU having a reasonable level of nitty-gritty knowledge and you will HAVE to read Microchip DATA SHEETs.
4. When selecting PICs suitable for Bootloading you obviously know the requirements re: Flash?

Download Tiimes.
Dear oh dear. I have to agree with BB about the time/impatience comments. That made me grin.

The Basics.
All compilers have a 2 stage approach to programming a PIC including the PE.
(WestAust, please don't give a lecture on all the Compilers approaches to compiling and optimisation :) I realise there are really more than 2 stages but let's keep it simple eh?)
First they all compile (in the loose [with 2 'o's] sense of the meaning) and then they load the PIC. 2 stages.
The advantage that 'Big Boy' compilers have is that they produce a Hex Code file which can (optionally) be loaded separately which obviously saves time i.e. once you have compiled you can then just download the hex to the PIC, thus saving time.

Then there are basically 2 methods of loading (programming) the PIC.
1. Using a Hardware programmer using the PGD/PGC (Data/Clock) pins on the PIC.
or
2. Via a Bootloader and (usually) using the Tx/Rx PIC pins of the USART. However, the this Bootloader must be pre-programmed onto PIC using a Hardware programmer. Then you will need some 'loader' software to do this - or write your own (haha!).
(The Bootloader is basically a little drop of code plonked onto the PIC allowing subsequent programme downloads via other pins, usually the USART, but in many cases the Bootloader will limit the programming options.
PICAXE firmware is more complicated than a simple off-the-shelf Bootloader.)

Actual Times?
Well, if you compared a Compilers compile+download time (whether via hardware programmer OR bootloader) to a PIC you'd probably find it slower than the PE time for programming PICAXE.
But if you bought a Programmer and simply loaded the (previously compiled) hex file then it would be quicker. But then it might be slower depending on programming options such as blanking and code verification. In either case don't expect lightning speed it will still take a few seconds.
It depends so much on code size and options.
But the big time advantage is being able to load the hex and NOT having to recompile each time.
(Thinks: Why can't a 'Just Download' button be incorprated into PE ?)

Should you move to a Compiler and Blank PICs?
Even a good PICAXE BASIC programmer would have to spend time stepping up to a 'Big Boy' BASIC compiler IDE.
If you are up to it then have a go.... so:-
A) Polish the credit card, or borrow your Mum's
B) Put your glasses on to read the Microchip Data Sheet which will takes days/weeks/years.
C) Tear your hair out when you realise how much is 'done for you' by PICAXE.
D) Realise the benefits of an overloaded subroutine structure.
... and I'll see you in a few weeks/months time when you've learned how to do an Interrupt (without pinching other people's code).
Good Luck, I'm off.
 

hippy

Ex-Staff (retired)
Everyone seems to have covered the main topics so I won't repeat that, but one important thing to repeat - Don't confuse download times with program execution speed once downloaded.

In my experience downloading to a PICAXE is comparable to downloading by any other means and doesn't require any money to achieve it; just add the 10K/22K to the PICAXE and connect it up. The Programming Editor only downloads as much as it sensibly needs to so it is usually fast but a 28X1 packed full of program code will take longer than one with less code.

Using the PICAXE and Programming Editor it is usually a case of writing the code, clicking "Run" and the PICAXE then runs it. For other microcontroller development it can be a lot more complicated, using multiple applications for compiling, downloading and debugging and even having to take the chip out of circuit and put it into a programmer to program it. There's nothing more frustrating and confusing than finding the programmer didn't burn the latest code and the bugs you hoped to remove are still there ! Much less chance of that happening with the PICAXE and Programming Editor.

The PICAXE does run slower than a PICmicro but that's largely because it supports high-level commands; once you've written the equivalent code in assembler you still have to call it and by the time you do it can become nearly as slow. And you have to write that assembler code to use it and, before doing so, learn how to which is no easy task. Not to mention the debugging effort involved in getting it right. Or you spend moey on the tools which cut down that development cycle.

The PICAXE is great for Rapid Application Developent (RAD) and very suitable for many projects but not all. Then again, nothing ever is.
 

tiscando

Senior Member
Thank you all for the advice. So, for the projects which require fast timing, I would get a 28x2, and use a 10mhz resonator to overclock it up to 40mhz.

I was looking at the pic chips on rapidonline.com, and the ones used by picaxe can be clocked up to 20MHz. Is this still true after the bootstrap is downloaded onto e.g. the pic12f683 to make it a picaxe 08m, or would it then only go upto 8MHz?
 

Andrew Cowan

Senior Member
Read the manual!

Page 72, manual 1 says they can run at 20MHz, although programs can only be downloaded at 4,8,or 16 MHz.

Andeww
 

papaof2

Senior Member
Time Critical solution

what should i use for a time critical project? another chip?
An open wallet can usually provide quick answers. I'm sure there's someone on the Forum that can provide a solution for $50US an hour...

John
 

Dippy

Moderator
There are several I should think papa. A colleague charges £55 per hour by the way. Almost as bad as a cheap Lawyer.

Andrew, I thought both 'run' and F5 did a 'compile' and programme?
Does it just download something previously 'compiled'? I didn't know that. Thanks.

I agree, it does appear that downloading times and execution times are being confused.
And I went over the 30 line yawn threshold, sorry.


tiscando,

You see, this is where you start needing to read the actual PIC Data Sheet.
The 12F683 can stand up to 20MHz for an external osc and has an internal 8Mhz osc.

You may be able to get a tiny basic Bootloader for a 683, but most pros wouldn't do it as any Bootloader take space and there is precious little on the 683 to start with. One may exist, I simply don't know and life is too short. I'm sure if someone hasn't got anything interesting to do they might find a tiny bootloader and tell us all about it...

It is an uphill struggle to take the next step tiscando... as you are discovering. I'd stick with PICAXE until you have a clearer concept of PIC. A good teacher/lecturer or an experienced person would give you a good start though. Finding one is a bigger problem.

Hippy
"There's nothing more frustrating and confusing than finding the programmer didn't burn the latest code and the bugs you hoped to remove are still there ! Much less chance of that happening with the PICAXE and Programming Editor."

What's wrong with ICSP? Whether it be by programmer or via Bootloader. I have been using various programmers plugged straight into a PCB header to PIC.
But I'm sure you knew that and were just teasing.
And if your Prgrammer isn't programming when you ask it to then throw it away, or select 'verify' :) .... always blames his tools.....
 

hippy

Ex-Staff (retired)
So, for the projects which require fast timing, I would get a 28x2, and use a 10mhz resonator to overclock it up to 40mhz.
Not technically "overclocked" because it would still be operating within manufacturer's recommended parameters but, yes, a 28X2/40X2 with a 10MHz crystal using 4x PLL giving 40MHz will be the fastest PICAXE.

The 28X2 and 40X2 are based upon the 18F2520 and 18F4520 which is why they can run faster. They will also be capable of running in standalone, single-chip mode using the familiar internal 4MHz/8MHz oscillator.

I was looking at the pic chips on rapidonline.com, and the ones used by picaxe can be clocked up to 20MHz. Is this still true after the bootstrap is downloaded onto e.g. the pic12f683 to make it a picaxe 08m, or would it then only go upto 8MHz?
The legs for crystal connection are used for I/O on the smaller PICAXE's so there's no ability to connect such a crystal thus they are limited to 4MHz/8MHz operation using the internal oscillator.

It would be possible for Rev-Ed to create an 8-pin PICAXE variant which ran at 20MHz with an external crystal but it would not be pin compatible with the 08/08M, would only have 3 I/O maximum and have to operate at 4V5 to 5V5. I doubt there's much of a market for that to make it worthwhile. I am sure Rev-Ed would however consider such a device if a commercial company had a serious intent to place a large enough order for such a thing.
 

hippy

Ex-Staff (retired)
What's wrong with ICSP? Whether it be by programmer or via Bootloader
Absolutely nothing ... providing the circuit is ICSP tolerant or has been loaded with a bootloader ( a bit of a Catch 22 that one ).

I did look at bootloaders for PICmicros but I haven't found any as nice as the PICAXE bootloader. Most will not use the same pinout and require a MAX232 style interface. Few I found are capable of checking that the device programmed is the same as that compiled for. None had such a nicely integrated development environment and then there's the jumping through hoops to make code compatible with the bootloader.

The reason I chose PICAXE was that it makes so much so easy and so cheap. The ease of use, pre-installed firmware and the free support through the forum more than makes up for the mark-up added to the price of a blank PICmicro.

And if your Prgrammer isn't programming when you ask it to then throw it away, or select 'verify' :) .... always blames his tools.....
More the problem of getting out of synch; the compiled .HEX not being the one loaded into the programmer application, verifies but the wrong .HEX to start with. It does depend on the toolchain used. With the Programming Editor, the source selected will be that which gets compiled and downloaded.
 

Dippy

Moderator
"( a bit of a Catch 22 that one )."
- yes that was what I was trying to imply in my overlong thead.

"providing the circuit is ICSP tolerant"
- usually a piece of cake, except when Sod's law is in conjunction with a Full Moon :)

"or has been loaded with a bootloader"
- unless something connected to UART decides to reply ....

'Workaround' is a wonderful word.

'toolchain' love it. Bless you. Is Jargon-overload a valid phrase?
Sounds more like a screwup to me followed by some amusing and feasible excuses. I must use that one for myself ;) - with your permission...?
 

hippy

Ex-Staff (retired)
'toolchain' love it. Bless you. Is Jargon-overload a valid phrase?
Sounds more like a screwup to me followed by some amusing and feasible excuses. I must use that one for myself ;) - with your permission...?
:)

I use two programming applications; one handles PIC devices which the other doesn't but isn't my favourite, that auto-loads a changed .HEX but the other doesn't. Indeed it is operator screw-up when moving from one to the other and forgetting it doesn't.
 

papaof2

Senior Member
"toolchain" - Isn't that a device made of metal links which is welded between a tool's handle and a workbench to keep said tool from walking off?

John
 

kamilan

Member
Should I use a PIXAXE

Hey there guys.

I am a masters student. The problem is I'm trying to make a commercial product... in other words needs to be dirt cheap. I've programmed in assembler in my undergrad, but that was real basic stuff.

Would need to know more about the project.

1. is secondary school or university project?

University Project

2. what degree of accuracy do you need? Probably related to Q1.

Accuracy to 1 cm meaning a running a clock at 35 kHz

3. what medium will the sound travel through?

Air at 21 degrees room temperature. May fluctuate by +/- 2 degrees

4. what is the length of the path over which you will be measuring?

Maximum length is 10 meters.

5. Is time critical meaning high accuracy or it has to be done yesterday?

Time critical meaning high accuracy

A solution... Maybe?

The idea of my project is to use the speed of sound to triangulate a robots position in a room. I have designed an audio beacon (one of three) that gives a Hi when a 1200 kHz signal is detected via radio signal. This beacon can pick up a 1200 kHz signal from a computer speaker 10 meters away.

Radio signals are an electromagnetic pulse which travels at the speed of light. For this project we are assuming that the communication between radio transmitter and receiver are instantaneous.

The robots brain is a laptop with Labview and a I/O box. The problem with the I/O box is that Labview is windows based and using software provides ridiculous results.

My idea was to take all the "thinking" away from the software and use dedicated hardware. So I started looking at PICAXE for starters. However if all else fails I will just use an 8051 which is over kill for the application intended.

A possible solution using the AXE007M PICAXE-08M microcontroller by over clock it to 8 MHz so that I can use the counter function at 50 kHz.

Set up a counter to count clock pulses of 50 kHz for no more than 100ms. This means I will have a 6mm +/- 0.5mm resolution.

Use one pin for an input from a pc using Labview. Bare with me as I will use pysdo code to try and explain my thinking.

PIN 1 = PCIN
PIN 2 = Clock ;The pin the 50Khz clock is connected to.
PIN 3 = Make Beep
PIN 4 = RadioSignal

Main;
for PCIN = 1 do
wait 1000ms
Clock IN ; Starts a subroutine that starts counting a 50kHz clock
Male Beep = 0; switchs off beep
reset interrupt
Math ; apply as much math as the picaxe can handle
goto main ; for process to be repeated

Clock IN;

if RadioSignal = 0 then
Make Beep = 1 ;Triggers external hardware make a 1200 kHz beep
counts ;counts 50kHz clock until external interrupt on PIN 4
else
exit Clock IN ;Next line of code in Main to be executed

I understand that the count function can count pulses for a defined period. The maximum distance will be 10m there for the defined period will be 30ms.

If someone could point out if this method could work it would be greatly appreciated.

Cheers

Kamilan
 

Mycroft2152

Senior Member
Commercial projects are $100 per hour plus a % of sales.

Why should anyone give away technical expertise for a commercial project?

Here is some free advice:

Read the manuals and start trying different things.

Myc
 

westaust55

Moderator
A possible solution using the AXE007M PICAXE-08M microcontroller by over clock it to 8 MHz so that I can use the counter function at 50 kHz.
As Mycroft says . . . read the PICAXE manuals.
Tend to agree with him.

I work the other way . . I am happy to use my years of work related experience to help in people in their hobbies/studies but asking people to commit a lot of time to a commercial project for free is like ouch :rolleyes:

In manual 2 the SETFREQ command is covered and 8MHz is a standard operating speed (okay default is 4Mhz) so not overclocking.
So its just a command away. . . . .
 

Mycroft2152

Senior Member
As Mycroft says . . . read the PICAXE manuals.
Tend to agree with him.

I work the other way . . I am happy to use my years of work related experience to help in people in their hobbies/studies but asking people to commit a lot of time to a commercial project for free is like ouch :rolleyes:

In manual 2 the SETFREQ command is covered and 8MHz is a standard operating speed (okay default is 4Mhz) so not overclocking.
So its just a command away. . . . .
Westy's response was much more politically correct.

I have no problem in mentoring (that is guiding) the hobbyist to discover a solution. The PICAXE is a lot of fun to learn and use.

But when it comes to commercial projects and school work, you have to do your own work.

This topic regularly crops up on the forum.

TANSTAAFL!

Myc
 
Last edited:

kamilan

Member
actually...

Actually, I'm not asking for anyone to dedicate any "time" to my project. Just asking if the chip is going to do what I need.

I don't want any code from you people. Just, whether or not the chip can be used for this process.

The manuals and spec sheets say one thing, but peoples experience is another.

Obviously not in this case!

Cheers

K
 
Top