english and PIC instruction

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Hi All!

I would like u to explain to me what is meant by the following:
"The LED should flash every 1 second"

Does that mean that the LED should be "on" for 1/2 a second and "off" for 1/2 a second too? I'm a bit confused...

Also what's the difference between:
- decfsz count, 1
- decfsz count, f
- decfsz count

Thanks for all ur replies!
 

Kermit2

Joined Feb 5, 2010
4,162
any combination of on and off times totaling 1 second would be appropriate

The first command has an integer of one which the program uses to decrement the count with.

The second has a variable to use for the decrement, the variable can be anything the programmer decides

The third is simply a command with no declaration variable. Some languages will use this and default a one, others will require the variable/integer be declared
 

Markd77

Joined Sep 7, 2009
2,806
Also what's the difference between:
- decfsz count, 1
- decfsz count, f
- decfsz count
They are all the same, F is defined somewhere as 1, and the default if you omit it is also F.
Open the "disassembly listing" window if you want to check.
 

Potato Pudding

Joined Jun 11, 2010
688
I would read that as being on for 1 second and then off for 1 sec.


It would be a 2 second repeating cycle or 0.5 Hz frequency but the changes or flashes would be at 1 second intervals.
 

THE_RB

Joined Feb 11, 2008
5,438
No, the qualifier "EVERY 1 second" must denote that an act takes place every 1 second, ie that act must have a frequency of 1 second.

The act is defined as "LED should flash" so in the absence of any details of duty cycle etc there must be 1 flash every second and a duty of 50/50 would be very reasonable.
 

ErnieM

Joined Apr 24, 2011
8,377
I would like u to explain to me what is meant by the following:
"The LED should flash every 1 second"
I would take that as the period is 1 second, and the duration is "flash." So the LED comes on once a second, for some time less then a second, as "flash" can mean many things.
 
Hi there,

Square waves (such as waves produced by MCU pins turning on and off) have a frequency (literally, amount of times per second it turns on/off) and a period, which is how long the signal is 'on' for. Obviously there's not much point having a period of longer than (1/freq) seconds, as that would just be on constantly.

In the phrase you gave, the only thing specified is the frequency. So, provided the period is less than 1/freq, it can be anything. A period of 1.5 seconds would be fine.

Thanks,
Barnaby
 

THE_RB

Joined Feb 11, 2008
5,438
I would take that as the period is 1 second, and the duration is "flash." So the LED comes on once a second, for some time less then a second, as "flash" can mean many things.
Exactly.
"LED should flash every 1 second";
Then "every" denotes a repeating act which is frequency, hence frequency is 1 per second. You can't talk "every" without talking about a continuous repeat.

If he had said;
"LED should flash for 1 second";
Then "for" would apply to a specific single flash characteristic which would most likely be the ON period of the LED.
 
Top