Your recollection is misleading. He was asked to do something different, specific enough.As far as I remember you could also use the PWM module of the PIC to generate different signal forms.
well i do know how to make the lookup table for the sine wave, and i was thinking of generating the square wave using timer0, im not sure what i can do about the triangle, i wasnt given much detail about what i need to do with this project, like for example i duno how i can chose between which wave signal i want as output. thats what i need help with just a little bit of organization its ind of all over the place.You need to show some effort to solve YOUR homework problem. Describe how you are going to break down the tasks that need to be accomplished and at least describe WHAT has to be accomplished and HOW you think you might go about accomplishing it.
Hola WBahnBecause if she does it "exactly" the same way, then they will both be sine waves!
But the suggestion is very valid. You will probably have some code inefficiency as a result, but the simpler implementation will probably be quicker and more robust and what you give up in "unnecessary" look up table data you may well gain back in simplified code structure.
I'm agreeing that, from most perspectives, a LUT-based approach makes more sense. Other factors weigh into it, for instance if you don't have enough space to store the LUT data. Also, you may make it LUT-based but still not universal in that you may be relying on various degrees and types of symmetry to reduce the size of the LUT.Hola WBahn
I am afraid that to make it "universal" the LUT is what should be changed with the procedure staying the same. Simplifying the code by playing numeric tricks would mean, most probably, to write different (albeit simpler) code for few signals other than sine. A nice exercise but not practical.
The paragraph above transpires the lecturer on you. Good! I agree!.I'm agreeing that, from most perspectives, a LUT-based approach makes more sense. Other factors weigh into it, for instance if you don't have enough space to store the LUT data. Also, you may make it LUT-based but still not universal in that you may be relying on various degrees and types of symmetry to reduce the size of the LUT.
Plus, at the end of the day, a big part of what matters may well be the fact that this is an exercise intended to achieve certain things, practicality notwithstanding. We have no idea based on what has been presented, but it could well be that different implementation methods for each of the waveforms is what is expected.
by Duane Benson
by Jake Hertz
by Aaron Carman