PIC Programming Help

Discussion in 'Embedded Systems and Microcontrollers' started by Cadague, Apr 28, 2010.

  1. Cadague

    Thread Starter New Member

    Mar 29, 2010
    12
    0
    Hello,

    My name is Casey Dague, and I am currently a senior at Jefferson High School in Cedar Rapids. My partner, Trace Minor and I, are working on a design project for a capstone engineering course, engineering design and development, as part of Project Lead the Way.

    We are nearing the end of the school year, and need to develop a circuit using the PIC12F675 chip. This circuit will involve the use of a trigger switch, reset switch, a driver and a speaker. We would like to create a program which, when triggered, will initiate a 2 minute countdown. After this countdown, the circuit would begin to give off a tone through the speaker at 2 second intervals at about 1.7kHz. Additionally, we would like to have a reset switch which will stop the time delay/turn off oscillator.

    This seems simple, but we have virtually no prior knowledge of microcontrollers. We have the PIC Chip and MPLAB loaded, but we don't have much understanding of the workings of the program.

    We need to complete this within the next couple of weeks, so your help is much appreciated.

    Thanks
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Post the circuit you are using with the pic, this will be necessary in guiding you on how to write the code, we can not help with the code without knowing the hardware first since that is what the code is based on....

    What state are you in??
    Do you have a programmer for the pic? (as in a Pickit2/3, etc.)

    B. Morse
     
    Last edited: Apr 28, 2010
  3. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    This shouldn't be too difficult. As bmorse asked, which programmer are you using for the PIC? And have you decided on a language?

    Is there a language requirement with the project, like it has to be done with ASM or C?
     
  4. Cadague

    Thread Starter New Member

    Mar 29, 2010
    12
    0
    There is no programming language requirement for the project, so which ever language would be easiest to understand would be ideal.

    We will be using the pickit 3 programmer.

    We had initially developed a circuit using ttl and cmos 555 but decided that the power consumption and size were much too large and that integrating it into one device would be most efficient.
     
  5. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Wow, cmos 555 is a pretty small draw. What are your consumption requirements?

    Is this battery powered or wall-wart plug in type?
     
  6. Cadague

    Thread Starter New Member

    Mar 29, 2010
    12
    0
    it is battery operated. with the cmos 555, the main problem was size, not power consumption. We did get fairly good results with the CMOS version. with one chip instead of 3 or 4, and not dealing with capacitors and resistors, the size is considerably lowered.
     
    Last edited: Apr 28, 2010
  7. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Ok. Let me see if I can find some info.
     
    Last edited: Apr 28, 2010
  8. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Casey,

    Did you mention the duration of the 1700 Hz tone at 2-second intervals? Do you mean 2-seconds tone "on" and 2-seconds tone "off"?

    Mike
     
  9. Slik_Willie

    New Member

    Mar 14, 2010
    5
    0
    Hi there,

    I am just getting started with a project that is due in 4 weeks interested in learning assembly and C language. There are tons of books on the subject but its hard to tell which is really good. Can you recommend any sources, books etc.

    Your help will be appreciated.
     
  10. maxpower097

    Well-Known Member

    Feb 20, 2009
    795
    388
    Not that its a big deal but you may want to change your names you posted. People and data miners collect this stuff and catalog your info. May not be a big deal but I recently started working for the federal gov and was astonished how much info they had on me in their database. Even an email I never gave them. But anyways you don't want too much data on yourself floating around the web unsecured. :)
     
  11. Pooja Goel

    New Member

    Apr 26, 2010
    6
    0
    Hi i am using pic16f84a.plz tell me if we can use jnz jc and jz instructions in it if not what should be the subroutine for this purpose.
     
  12. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    They are substitutes for other pairs of instructions,
    jnz = jump if not zero
    jc = jump if carry
    jz = jump if zero

    You can use them, if you want to know what they compile to check the assembler output.
     
  13. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Please do not hijack other threads. Start your own. Then people hijack the thread become difficult to follow.
     
  14. Cadague

    Thread Starter New Member

    Mar 29, 2010
    12
    0
    MMcLaren, I would like the circuit to turn on for 2 seconds and off for 2 seconds until reset, or until the circuit times out after 5 minutes.
     
  15. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Your post makes no sense in this context. Start your own thread.
     
  16. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Cadague is the OP and this was an answer to a poster:)
     
Loading...