Search found 26 matches

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

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: 3104

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: 3104

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: 3104

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: 3104

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: 3104

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: 1462

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: 3104

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
by mikenick42
Sun Aug 16, 2015 8:57 pm
Forum: AVR Support
Topic: PWM frequency
Replies: 10
Views: 3104

PWM frequency

I have a Mega 2560 clone that seems to work fine with the ChibiOS demo. But when I run the PWM hal test, the light just blinks quickly. It looks like maybe the PWM frequency is set too low. Changing the values in pwmEnableChannel makes it blink faster or slower, but it's not the fade I would expect ...
by mikenick42
Sat Aug 15, 2015 10:03 pm
Forum: AVR Support
Topic: ChibiOS on the Arduino Uno
Replies: 5
Views: 2643

Re: ChibiOS on the Arduino Uno

deviware? Did you ever make any progress on a patch?

Go to advanced search