#include "UGSheader.h"
#include "Timer.h"

void SetPWMt ( unsigned double Fosc, unsigned int Fout, short unsigned int Ps)
{

	unsigned int on, off;
	
	on = (65535-((Fosc*duty)/(4*Ps)));
	off =  (65535-((Fosc*((1.0/Fout)-duty))/(4*Ps)));
	
	onH = on>>8;
	onL = on & 0xFF;
	
	offH = off>>8;
	offL = off & 0xFF;
		
	T0CONbits.TMR0ON = 1; //timer0 on
	
}