Programming Assignment?

This is a discussion on Programming Assignment? within the C Programming forums, part of the General Programming Boards category; Hey guys..I'm an electrical engineering student and for one of our assignments we're required to create a program to communicate ...

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Programming Assignment?

    Hey guys..I'm an electrical engineering student and for one of our assignments we're required to create a program to communicate to one of our microcontrollers..I'm not even sure if the program needs to be written in C (as I'm not too familiar with coding)

    Could you guys possibly direct me towards some helpful resources?

    Here's what my assignment looks like

    5. DI + PWM
    Write a program that outputs a 75% duty cycle waveform at 1kHz on a PWM pin when a digital input is high, and 25% duty cycle when the input is low.

  2. #2
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    880
    There must be more information than that.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,145
    PWM is just a loop. In your case, a 4-steps loop will do. For 75%, output high for 3 steps, and low for 1, etc. Make sure each iteration of the loop takes 0.25ms (since you want a wave with a period of 1ms).

  4. #4
    1337
    Join Date
    Jul 2008
    Posts
    135
    Probably you will be using assembly. Google nigel's tutorial. It is kind of a good tutorial tough. By the way, if your microcontroller is 32bit, then probably you will be using C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu
    By Krush in forum C Programming
    Replies: 17
    Last Post: 09-01-2009, 02:34 AM
  2. Assignment Operator, Memory and Scope
    By SevenThunders in forum C++ Programming
    Replies: 47
    Last Post: 03-31-2008, 06:22 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Help with a pretty big C++ assignment
    By wakestudent988 in forum C++ Programming
    Replies: 1
    Last Post: 10-30-2006, 08:46 PM
  5. Replies: 1
    Last Post: 10-27-2006, 01:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21