Using Output Compare
Posted: Tue Jun 29, 2010 9:59 pm
Hello Lubin,
I just wanted to confirm that I'm using the OC Output Compare block correctly...
First off, it seems like OC1max is a constant that is relevant to the chip. Is there a way I inherit it from the chip, because just making a constant block called [OC1max] does not work.
Additionally, if I wanted to set up a 50% wave at 2 KHz, then I would need Max / Channel to be set to 0.0005 and up would be (0.00025 / 0.0005 )* OC1max?
What do I set Period to, as it needs an integer input?
Thanks!
I just wanted to confirm that I'm using the OC Output Compare block correctly...
First off, it seems like OC1max is a constant that is relevant to the chip. Is there a way I inherit it from the chip, because just making a constant block called [OC1max] does not work.
Additionally, if I wanted to set up a 50% wave at 2 KHz, then I would need Max / Channel to be set to 0.0005 and up would be (0.00025 / 0.0005 )* OC1max?
What do I set Period to, as it needs an integer input?
Thanks!