Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Before I go down this route I'll pose this question.
Would an arduino uno Pwm o/p be configurable to o/p exactly (assuming the 16mc xtal is spot on) 200 khz.
So it doesnt look like it.
Might look at the Attiny, I remember one of those can go very high.
I want a 200khz 50% fixed waveform thats derived from the system clock.
Edit: Some of you guys will have a problem believing this, I installed Pwm.h from github, changed the pwm freq to 200,000, set the duty to 127, connected my fluke scopemeter, and it says I have 200 khz, nope I havent got hz & khz mixed up, the period is indeed 5uS.
No idea whats going on, but I'm gonna use it as the start of my project.
Maybe its not using the prescaler or something.
void setup() {
TCCR0A = 2 << COM0A0 | 2 << COM0B0 | 3 << WGM00;
TCCR0B = 0 << WGM02 | 1 << CS00;
TCCR1 = 0 << PWM1A | 0 << COM1A0 | 1 << CS10;
GTCCR = 1 << PWM1B | 2 << COM1B0;
pinMode(pwm, OUTPUT);
pinMode(potinput, INPUT);
pinMode(feedbackinput, INPUT);
digitalWrite(pwm, LOW);
pwmval = 0;
}
I guess that will work.I want a 200khz 50% fixed waveform thats derived from the system clock.
/ Port D initialization
// Function: Bit7=In Bit6=Out Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=In
DDRD=(0<<DDD7) | (1<<DDD6) | (0<<DDD5) | (0<<DDD4) | (0<<DDD3) | (0<<DDD2) | (0<<DDD1) | (0<<DDD0);
// State: Bit7=T Bit6=0 Bit5=T Bit4=T Bit3=T Bit2=T Bit1=T Bit0=T
PORTD=(0<<PORTD7) | (0<<PORTD6) | (0<<PORTD5) | (0<<PORTD4) | (0<<PORTD3) | (0<<PORTD2) | (0<<PORTD1) | (0<<PORTD0);
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 16000,000 kHz
// Mode: CTC top=OCR0A
// OC0A output: Toggle on compare match
// OC0B output: Disconnected
// Timer Period: 2,5 us
// Output Pulse(s):
// OC0A Period: 5,00 us Width: 2,5 us
TCCR0A=(0<<COM0A1) | (1<<COM0A0) | (0<<COM0B1) | (0<<COM0B0) | (1<<WGM01) | (0<<WGM00);
TCCR0B=(0<<WGM02) | (0<<CS02) | (0<<CS01) | (1<<CS00);
TCNT0=0x00;
OCR0A=0x27;
OCR0B=0x00;
Yes I'm familiar with the Esp32 its a cool chip.
But I'mnot so sure about the web server that comes with the core.