english and PIC instruction

Discussion in 'Embedded Systems and Microcontrollers' started by Eric007, Aug 21, 2011.

  1. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    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!
  2. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    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
  3. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    Thanx so muck Kermit2!!!

    I'm happy!
  4. Markd77

    Senior Member

    Sep 7, 2009
    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.
  5. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    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.
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    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.
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    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.
  8. Barnaby Walters


    Mar 2, 2011
    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.

  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Huh? 1.5 seconds is larger then 1 second. I think you missed a decimal point somewhere.
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    "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.