Hallo habe folgendes mini prog um pwm zu testen
um die funktion zu prüfen will ich eine LED angeschlossen an PINd.7
synchron zum OC1a steuern
PWM -Ausgang geht ,LED -Port hat 0V
WARUM????
Code:$regfile = "m168def.dat" ' specify the used micro $crystal = 16000000 ' used crystal frequency $baud = 9600 ' use baud rate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 32 ' default use 10 for the SW stack $framesize = 64 ' default use 40 for the frame space Config Pind.7 = Output Config Pind.6 = Output Config Pinb.1 = Output Config Pinb.2 = Output Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up , Prescale = 8 Compare1a = 150 Compare1b = 150 Do Portd.7 = Portb.1 Portd.6 = Portb.2 Loop







Zitieren

Lesezeichen