Timers and PWM

Discuss the Firewing language

Timers and PWM

Postby AndrewB » Sun Feb 28, 2016 11:49 am

I have a Firewing24 and have a single PWM setup.
I'm guessing that I cannot use progtimers? as my programme crashes if used.
Is there an alternative way to do this or any guidelines on how to do it properly.
AndrewB
 
Posts: 94
Joined: Thu Jan 02, 2014 3:38 pm

Re: Timers and PWM

Postby Jerry Messina » Sun Feb 28, 2016 2:39 pm

I haven't tried this so I could be wrong, but it looks like since the PWM module uses TIMER2 and the timers.bas/progTimers.bas module uses TIMER1 I would think they could be used together.

The default progTimers sample uses some of the same IO pins that the PWM module can use (D3, D5, D6) so that might mess up the PWM but normally the peripheral has priority over the IO pin. There's no source for the internal libraries, so I can't verify that.

Maybe if you showed an example of what you're doing it would help.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: Timers and PWM

Postby AndrewB » Sun Feb 28, 2016 3:32 pm

Ive added a few delays for the main and have the adc sense in the interrupt and so far looks ok.

Would anything in the DS1307 and DS18B20 modules be effected as I have had problems with setting and reading from both when the interrupt was setup.

I had set memory positions and read them from the DS1307 but it would sometimes reset the data to 0. I have fixed values at the moment.

Time.seconds when displayed changes for some reason when the pwm signal is changed.

Probably my code but was thought that the interrupt may be effecting it.
AndrewB
 
Posts: 94
Joined: Thu Jan 02, 2014 3:38 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 3 guests

cron

x