PDA

View Full Version : New with questions



Terke
- 3rd December 2005, 03:34
Hi All,

I am new to the forum, and pretty new to PBP. I don't know if this is the right place to post this question. If it is not, better send me to the right spot because I have lots more coming.

So far PBP has been great to use. The manual is perhaps a bit sparse when it comes to the explanation of the commands. If I should be looking in different documentation please advise.
If using the PULSEOUT command does the program stop running for the duration of the pulse? I want to make a pin go high and some time later go low. The timing of this pulse is critical, and there is not enough time to sit and wait for the period to pass, lots of other tasks must continue while this pin is high. The period the pin is high varies a lot, so I can't try to run other pieces of code by 'squeezing them in'.

Thanks for your help

Melanie
- 3rd December 2005, 09:46
You appear to contradict yourself... first you say...



...there is not enough time to sit and wait for the period to pass, lots of other tasks must continue while this pin is high...
then you say...


The period the pin is high varies a lot, so I can't try to run other pieces of code by 'squeezing them in'

Now you either want to run other pieces of code whilst your pulse is being generated, or you don't...

Either way, whilst PULSEOUT is running you can't do anything else in your code during that time. Chose a different method to generate your pulses (example HPWM) if you wish to execute code simultaneously with your pulse generation.

NavMicroSystems
- 3rd December 2005, 13:20
...I want to make a pin go high and some time later go low. The timing of this pulse is critical...

give us an idea of the length of that pulse, is it microseconds, minutes, hours . . .?

Terke
- 4th December 2005, 08:11
Guess I was a little unclear.

1) The fact that nothing else can happen during the excution of the 'pulseout' command is what I was afraid of.

2) Without saying so I was already thinking of different stategies, such as counting program steps and thereby 'squeezing' them into two commands i.e. pin high, number of program steps, then pin low.

To answer the question of the times in volved. The complete 'cycle' of the program will be 480ms to 20ms in length. During this time 8 ADC conversions have to happen, 4 values need to be looked up in various tables, 6 values need to be calculated from these lookup values, and 6 pins need to be driven high and low. Of which three pins need to be high for 2.1ms and the other three pins anywhere from 2ms to 15.5ms. Oh and the rising edge of one pin will need to be read, the period of which will vary between 160ms and 7ms.

Melanie thank you for your suggestion. I will go and review the HPWM command.

Cheers

Melanie
- 4th December 2005, 11:48
If your requirement is that complex, you will almost certainly have to use the PICs internal timers rather than my original HPWM suggestion. Don't even think about calculating instruction cycles, too much going on to even consider that option.

Terke
- 6th December 2005, 06:35
That's what I was afraid of.

Thanks Melanie