BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Jan 23, 2018 1:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: MBasic 5.3.1.6 pauseus
PostPosted: Wed May 26, 2010 9:41 pm 
Offline
Citizen

Joined: Wed Aug 20, 2008 5:57 pm
Posts: 27
I've been happy with he new MBasic release until I tried to use PAUSEUS. It seems that the shortest pulse I can generate is 300 uS. I've used pauseus many times in my 16F877 days. Now that I've moved to the new release and am programming 16F887's, pauseus doesn't behave like it used to.
This also applies to pulsout. I really need to make 5 uS pulses.
Does anyone know about this? Does anyone care anymore?
Thanks,
Wizard


Top
 Profile  
 
 Post subject: Re: MBasic 5.3.1.6 pauseus
PostPosted: Wed May 26, 2010 10:57 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
5us pulses are going to be tough. You can try using pauseclk but I think the minimum time is still going to be longer than that. To make shorter pulse you may need to use inline asm. Do you need just 5us pulses or do you need adjustable lengths down to 5us?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: MBasic 5.3.1.6 pauseus
PostPosted: Thu May 27, 2010 10:00 pm 
Offline
Citizen

Joined: Wed Aug 20, 2008 5:57 pm
Posts: 27
Thanks for the quick reply, Nathan.
I'm using the internal 8 MHz clock in the 16F887 and I had foolishly expected shorter pulses. I now recall that the last time I produced short pulses was with an 877 running 20 MHz. I needed the clock pins on the 887 for I/O and hence I'm stuck with the 8 MHz internal clock.

When I do this:
@high b0
@low b0

I get a 4 us pulse which is just fine for my pulse width.
If I do this:

@high b0
pauseus 5
@low b0
I get a 130 us pulse which indicates that that is the shortest pause I can get. I may be able to squeek through with this. I need to ramp the pulse repitition rate of the 4 us pulse from 1 kHz to 10 Khz.

Any ideas?
Thanks


Top
 Profile  
 
 Post subject: Re: MBasic 5.3.1.6 pauseus
PostPosted: Fri May 28, 2010 2:42 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
@high pin and @low pin are macros which use only a couple instruction cycles. Pauseus is a command which has entry code(approx 30 instruction cycles per token). Then the entry to the pause us command itself which is hard to calculate but is around 45 instruction cycles. You may want to try pauseclk for a shorter minimum time(it's a simpler command) but you won't be able to get as low as you are looking for I don't think, with basic commands.

There are macro commands for delays. They require constant arguments just like the @high and @low macros but can get you very short delays(down to 1us for @USDELAY).

@USDELAY cycles
@MSDELAY cycles

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: MBasic 5.3.1.6 pauseus
PostPosted: Fri May 28, 2010 5:44 pm 
Offline
Citizen

Joined: Wed Aug 20, 2008 5:57 pm
Posts: 27
Thanks Nathan.
I have compiled a small list of undocumented commands over the many years that I've been using MBasic. As far as I know, there has never been a list published.
I didn't know about:

@USDELAY cycles
@MSDELAY cycles

This is just what I need.

I sure wish I could search the archives of the old MBasic forum. I continued to get good info from it. Any chance the old forum could be reinstated?

BTW, the new MBasic Pro rev doesn't program 12c671 anymore. I have to switch back to the old rev to program them. Too bad.

Thanks for being here for me!
Pete


Top
 Profile  
 
 Post subject: Re: MBasic 5.3.1.6 pauseus
PostPosted: Thu Jun 03, 2010 2:31 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
Hmm, you should be able to put the 12C671 in the device ini for mbasic to get it back in. We didn't drop any support for older processors with that new release so it must have gotten accidentally removed.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO