Using assembler programming?

Chris DeHut

Senior Member
Hi everyone, sorry to ask this question again, but I am hoping to find the solution using PICAXE so I don't have to learn yet another programming language :-(

Here is my problem...

I need to create a pulse stream that can deliver up to 50,000 pulses per second, each about 5 usec in duration. Even using the 16 Mhz crystal, I know I can't do that with BASIC.

So, I have been thinking that I could do it if I used the Assembler output option and and wrote the program into a "standard" PIC. I know I will need to purchase the serial programmer from Rev-Ed and that's cool.

First, if I went this route, do you think it is possible I could achieve this rate of output?

Second, I will also need to communicate with a serial device to recieve / send data. Not a lot of communications during the pulse stream, primarily about 10 bytes of data every 2 seconds or so. I seem to recall that you can't use the serial in/out commands when using the Assembler output process. I went through all the documents yesterday again, and can't seem to find any reference to that so perhaps you can use the serial in/out commands with the assemblber output functions.

At this point I am a bit confused, and I am very well aware that I am probably pushing the PICAXE system a bit too far, but frankly I like it so much, I really don't want to use anything else if at all possible!

Thanks again!

Chris
 

Jeremy Leach

Senior Member
Is this an encoded pulse stream ?

The PICAXE chip is one processor ...it can't do two things at once whatever you program it in (although it can generate fixed pulse stream etc in background).

What I mean is ....if you're trying to generate a pulse stream, whatever else you do at the same time is very likely to have an impact , especiually at high pulse frequency.

Edited by - Jeremy Leach on 1/17/2006 3:58:54 PM
 

Chris DeHut

Senior Member
Yes, this is a single PIAXE. However, I am not opposed to use one each for each of the pulse streams. PWM won't work for what I have in mind either :-(

Chris
 

womai

Senior Member
the pic processors need 4 clock cycles per assembler instructions - except branching that needs more. so a pic running at16 mhz can execute up to 4 million instr per sec. 50000 cycles/sec would then mean you have 80 instr per cycle to work with - this should be plenty unless you plan on some really complicated processing.

wolfgang
 

andrewpro

New Member
***Heresy alert!!***

If you dont want to learn a new language (well..it's sorta different, but still basic) You could get an AVR. 8 pin ones are ~$1 US or so...definitly less than 2. You can get my favorite, the ATtiny26, a 20 pin dip that will run up to 16mhz with an external resonator, can be programmed with a very simple and cheap home made parallel port programmer.

Then you download the demo version of BASCOM AVR, which is fully functional, but will only compile 4k of code (used to be 2k but they upped it). Most of the "cheap" AVR's only hold 1 or 2k anyways, so it will work out perfectly.

It's not a picaxe, but you can program it in basic and it's pretty dern cheap, all inclusive: programmer less than $5, chips less than $2 usually, basic programming software $0, getting your 50khz perfect with a few lines of code and a little bit of effort, priceless ;).

--Andy P
 

Chris DeHut

Senior Member
Andy, once again you come to the rescue! I will look into that more. I posted a question on their forum earlier today and have not gotten any advice yet.

However, for a couple of dollars total investment, it is worth giving it a try. I saw the price for the software and was hesitating on going down that path. However, 4K of code space for this application is about 10 times more than I need (I think).

Thanks again!

Chris
 

Chris DeHut

Senior Member
Andy, sorry to bug you more but can you point me towards a programmer I can make/purchase to use with that compiler?

Chris
 

andrewpro

New Member
If you can take attatchments in your email, then mail me at the screwed up address below:

picaxe
at
plistin
dot
com

and I'll send you a pdf.

If you cant, I'll put it on my site temporarily, I dont know where I got it from, though, and dont know the rules of reproducing it in electronic form.

--Andy P
 
Top