Search found 28 matches

by mikenick42
Tue May 02, 2017 2:51 am
Forum: AVR Support
Topic: Fast system tick on AVR
Replies: 8
Views: 2742

Re: Fast system tick on AVR

Hi Theo, After some more reading today, I suspect that I'm coming at this the wrong way. I'm trying to use PWM to control a mains power source, similar to what's shown in Figure 4 here: https://electronics.stackexchange.com/a/233804 Using the default settings in ChibiOS I get ~67 system ticks betwee...
by mikenick42
Sun Apr 30, 2017 1:39 pm
Forum: AVR Support
Topic: Fast system tick on AVR
Replies: 8
Views: 2742

Re: Fast system tick on AVR

Hi Theo,

I'm using the stable 16.1 branch on an Uno.

Thanks,
Mike
by mikenick42
Sun Apr 30, 2017 4:47 am
Forum: AVR Support
Topic: Fast system tick on AVR
Replies: 8
Views: 2742

Fast system tick on AVR

I'm trying to get make a PWM dimmer for an AC source and am having trouble with the best way to do so. I can use chVTGetSystemTime() to check the ticks between zero crossings and get ~130 at 16MHz and ~65 with the internal oscillator. I want it to have small steps, so I've tried changing CH_CFG_ST_F...
by mikenick42
Wed Aug 26, 2015 2:56 am
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Thanks for the help Fabio, I just got it working with a simple fader to test out. It seems to work just fine.
by mikenick42
Mon Aug 24, 2015 3:11 am
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Hi Fabio,
Thanks for the fix and the tips.
I'll test out your changes as soon as they hit github.

Mike
by mikenick42
Sat Aug 22, 2015 5:21 pm
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Thanks for the help Fabio.
I zipped my project folder and included the slightly modified board.h from os/hal/boards/ARDUINO_MEGA/
I have it set up for tickless mode right now so I can use the led that's on the board rather than dealing with breadboards etc.

Thanks,
Mike
by mikenick42
Sat Aug 22, 2015 5:43 am
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Hi Fabio, I'm still having trouble. I start with a clean copy of the PWM program from testhal and change: AVR_SERIAL_USE_USART0 to TRUE in mcuconf.h Then I added: chnWrite(&SD1, (const uint8_t *) "Hello world\r\n", 13); just above the while(1){}. If I comment out pwmStart, I see "...
by mikenick42
Wed Aug 19, 2015 3:55 am
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Saying PWM worked may have been a bit premature. After noticing that I couldn't adjust the brightness of the LED. What I've found is that calling: pwmStart(&PWMD1, &pwm1cfg); seems to cause constant resets. I pulled the PWM code from testhal into the RT-MEGA demo and replaced pwmTogglePad wi...
by mikenick42
Wed Aug 19, 2015 3:37 am
Forum: AVR Support
Topic: Arduino Uno and Mega2560 support
Replies: 3
Views: 1700

Re: Arduino Uno and Mega2560 support

Diego, that's awesome. Can you explain you how got Chibi to fit on the Uno? I always ended up with ~150% RAM utilization.
by mikenick42
Mon Aug 17, 2015 3:18 am
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3541

Re: PWM frequency

Hi Fabio, I went into pwm_lld.c and changed the frequency scalar to 256 instead of 1024. It seems to be working now. When I set it to 8 the LED seemed to be at 100% no matter what the duty cycle was set to, thought it's possible I messed up and wasn't actually sending 010 to the register. Thanks, Mike

Go to advanced search