-
Datei
test2.3.asm
;Demoprogramm für 8-fach-PWM mit Tastensteuerung Up-Down. ;8 LEDs gegen Vcc an PortB (STK500) ;8 entprellte Tasten gegen GND für die einzelnen PWM-Kanäle an PortD ;1 "Shift-Taste" an PA6 gegen GND zum Wählen der Stellrichtung der
in „MENÜ-STEUERUNG“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ledctl.asm
timer 0 ; prescaler 8 ; zaehler 155-255 -> 100 schritte ; -> 10.000 interrupts/sec ; -> 100 Schritte PWM ; -> 100Hz PWM ;------------------------------------------------------------------------------- .include "m8def.inc" .org 0x000 .def tmp1 = r16 ; temporaer genutzes Register .def tmp2 = r17 ; temporaer
-
Datei
lauflicht.asm
auf Ausgang stellen BSF STATUS,RP0 ; Bank1 BCF TRISC, 2 ; RC2: output=0 BCF STATUS,RP0 ; Bank 0 ; PWM MODE mit CCP1 initialisieren CLRF CCP1CON ; CCP1-Modus aus BSF CCP1CON,CCP1M3 ; CCP1-Modus PWM-Mode BSF CCP1CON,CCP1M2 ; ADC vorbereiten ; PortB vorbereiten bsf STATUS, RP0 ; auf Bank 1 umschalten movlw
in „nicht kompatibel“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Neues_Textdokument.txt
sAN2 ); setup_adc(ADC_CLOCK_INTERNAL ); set_adc_channel(2); delay_us(10); //***** Initialisierung des PWM ***** setup_ccp1(CCP_PWM); // Configure CCP1 as a PWM setup_timer_2(T2_DIV_BY_1, 250 , 1); // 20000 Hz //2_DIV_BY_1 = keine Prescaler (also gilt 20MHz / 4) // ,250 = der Timer soll bis 250 zählen //
in „Problem mit H-Brücke“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
ab-EVAL6229PD.pdf
driving ',$* ▯▯9 5(1 386+▯38// 287387 (1 & (1 (6' 3527(&7,21 '▯▯,1▯▯▯▯9▯ 12/34 DocID9455 Rev 4 L6229 PWM current control 6 PWM current control The L6229 device includes a constant off time PWM current controller. The current control circuit senses the bridge current by sensing the voltage drop across an
in „BLDC Motor rotiert nicht trotz Spannung“ · Analoge Elektronik und Schaltungstechnik ·
-
PDF
PIC18F46J11_39932D.pdf
. It can do this through four different PWM Table 18-1 provides the pin assignments for each Output modes: Enhanced PWM mode. • Single PWM • Half-Bridge PWM Figure 18-5 provides an example of a simplified block diagram of the Enhanced PWM module
in „PIC18F46J11 und RTC. Quarz nötig? Anfängerfrage Übersicht verloren ;-(“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
### { if(play_buffer_number & 1) { #if R2R_DAC PORTA = play_buffer1[play_buffer_index]; #endif #if PWM_DAC OCR2 = play_buffer1[play_buffer_index]; #endif } else { #if R2R_DAC PORTA = play_buffer0[play_buffer_index]; #endif #if PWM_DAC OCR2 = play_buffer0[play_buffer_index]; #endif } play_buffer_index
in „Sprachausgabe mit AVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
README.txt
another frequence is used, the code needs to be changed - The CPU is 100% busy during output 2. FastPWM "manual": A timer and an output compare pin in FastPWM are used to generate the output signal + Even with different CPU frequence, the PWM timing can easily be changed to meet the requirements - A free timer with PWM must be available - During output also the CPU is 100% busy, because for each output bit the output compare register must be reloaded manually 3. FastPWM using DMA: A time and output compare pin in
in „AVR ASM ws2811 / ws2812 Ansteuerung mit FastPWM“ · Projekte & Code ·
-
Datei
t0_mod2.c
taster4 = P2^3; //Taster rechts //----------sonstige Eingänge---------- sbit pegel_ein = P1^3; //Eingang PWM Signal; Zeigt ob 0V oder 3V enspricht 0 oder 1 sbit pegel_aus = P1^4; //Ausgabekanal manuell erzeugtes PWM Signal timer0() interrupt 1 using 1 // Int Vector at 000BH { if(!--cnt_down0) { cnt_down0=10000
in „PWM Signal abfangen und speichern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
config.c
noise canceler, Capture edge select, Systemclock 16MHz /8 TIMSK |= (1<<TICIE1) | (1<<TOIE1); //timer2 /PWM TCCR2 |= (1<<WGM20) | (1<<WGM21) | (1<<COM21) | (1<<CS21) | (1<<CS20);//Fast PWM, clear OC2, Sys Clock / 32/~2kH PWM #elif defined(__AVR_ATmega88__) TCCR0B = (1<<CS01);// |(1<<CS00);// :8 TIMSK0 |=
in „optimize Os / O0“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
ATT5FCA9.pdf
AT90S4433 ATmega161 ATmega640 STK503 AT90CAN128 STK501 ATtiny26 AT90S4434 ATmega162 ATmega644 AT90PWM2 STK520 ATtiny28 AT90S8515 ATmega163 ATmega645 STK502 AT90PWM3 STK520 ATtiny4STK505 AT90S8535 ATmega164P ATmega649 STK502 AT90USB646 STK525 ATtiny45 ATmega8 ATmega165 STK502 ATmega2560 STK503 AT90USB647
in „Angebot STK500+STK501+JTAGICE“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
AVR_tutorial.pdf
rcall lcd_data mov temp1, code rcall lcd_data rjmp main .include "lcd-routines.asm" 167 A VR-Tutorial: PWM PWM - Dieses Kürzel steht für Puls Weiten Modulation. Inhaltsverzeichnis • 1 Was bedeutet PWM? • 2 PWM und der Timer o 2.1 Fast PWM o 2.2 Phasen-korrekte PWM o 2.3 Phasen- und Frequenz-korrekte PWM
in „AVR-Tutorial als PDF bzw *.doc“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
LGM11.44..._Gasfeuerungsautomat_Basisdokumentation.pdf
Drehzahl, deren Unterschreitung als Motorstill- 200 rpm 50 rpm 0...2 krpm stand interpretiert wird ^ VL_PWM PWM-Wert für Vorlüftung 100 % 1 % 0...100 % ^ ZL_PWM PWM-Wert für Zündlast 60 % 1 % 0...100 % ^ KOEFF Schrittweitenbegrenzung «PWM» beim Hochfah- 10 % 1 % 0...100 % ren (abhängig von Motor / Leistung
in „Schaltplan/Hilfe bei Steuerung Eurola OC“ · Haus & Smart Home ·
-
Datei
Kondensatormotor-sin_20200323c.ino
byte zahl = 1; int usin; int zsin; void setup() { TCCR1B = TCCR1B & B11111000 | B00000010; // for PWM frequency of 3921.16 Hz pinMode(upin, OUTPUT); // PWM pinMode(zpin, OUTPUT); // PWM analogWrite(upin,0); analogWrite(zpin,0); pinMode(enuppin,OUTPUT); digitalWrite(enuppin,HIGH); pinMode(enunpin,OUTPUT
in „Arduino Kondensatormotor Drehzahlsteuerung“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
Dual_LED_Dimmer.c
interrupt.h> #include <avr/pgmspace.h> #include <util/delay.h> // OC0A and OC0B //! Bit pattern of PWM pins placed on PORTB. #define PWM_PATTERN_PORTB ((1 << PB1) | (1 << PB0)) // connect the ch1 pot to this channel #define ADC_CHANNEL1_PIN PB4 // connect the ch2 pot to this channel #define ADC_CHANNEL2
in „Attiny44 ADC-Wandler Software-Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Dual_LED_Dimmer.c
interrupt.h> #include <avr/pgmspace.h> #include <util/delay.h> // OC0A and OC0B //! Bit pattern of PWM pins placed on PORTB. #define PWM_PATTERN_PORTB ((1 << PB1) | (1 << PB0)) // connect the ch1 pot to this channel #define ADC_CHANNEL1_PIN PB4 // connect the ch2 pot to this channel #define ADC_CHANNEL2
in „0-100% PWM mit NE555“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
main.c
/** ****************************************************************************** * File 07_PWM_EdgeAligned/main.c * Author MCD Application Team * Version V1.2.0 * Date 05-February-2016 * Brief This code example shows how to configure the timer * to generate a PWM edge aligned signal. * ======
in „STM32: SysTick_Config“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
hardwarepwm.bas
' Hardware Pwm Abstimmung für das Pollin Tunermodul $regfile = "m16def.dat" $crystal = 1000000 Dim A As Integer 'Variable für Abstimmschritte bei Stoppsignal Dim B As Bit Dim E(10) As Eram Integer Dim Zaler As Byte
in „PLL per Software“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
radiopwm.bas
' Hardware Pwm Abstimmung für das Pollin Tunermodul $regfile = "m16def.dat" $crystal = 1000000 Dim A As Integer 'Variable für Abstimmschritte bei Stoppsignal Dim B As Bit Dim E(10) As Eram Integer Dim Zaler As Byte
in „PLL per Software“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Neu_shiftin.bas
wieder herausgeschoben. 'Ein Strobe_Signal an PD3 übergibt das obere Byte an den Timer0, der eine PWM 'realisiert. Das untere Byte wird an Port B ausgegeben. An PD5 erscheint das PWM 'Signal, an PD4 und PD6 werden die Steuersignale für eine H-Brücke ausgegeben. 'Die Richtungsinformation liegt im Bit
in „Problem mit INT0 und INT1 bei Attiny2313“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Pwm_Abstimmung_f_r_Pollin_Radio1.bas
' Hardware Pwm Abstimmung für das Pollin Tunermodul $regfile = "m16def.dat" $crystal = 1000000 Dim A As Integer 'Variable für Abstimmschritte bei Stoppsignal Dim B As Bit Dim E1 As Eram Integer 'Senderspeicherplatz
in „PLL per Software“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Unterprogramme.h
Definitionen-------------------------------------------------------- #define FullSpeed 1023 //Motor ein für PWM #define HalfSpeed 512 //Motor halbe Kraft #define OFF 0 //Motor aus für PWM #define UART_BAUD_RATE 9600 //UART Baudrate #define BufferMAX 100 //Buffer für Stringumwandlungen und Typumwandlungen #define
in „Display-Menü programmieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Unterprogramme.h
Definitionen-------------------------------------------------------- #define FullSpeed 1023 //Motor ein für PWM #define HalfSpeed 512 //Motor halbe Kraft #define OFF 0 //Motor aus für PWM #define UART_BAUD_RATE 9600 //UART Baudrate #define BufferMAX 100 //Buffer für Stringumwandlungen und Typumwandlungen #define
in „Display-Menü programmieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
robot.c
generate voltages between VCC and GND using Pulse Width Modulation (PWM). A LED with a series resistor should be connected from PD5 to GND. See also Atmel AVR Application Note AVR130 *******************************************************************************/ #include
in „Problem mit PWM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
2.Versuch.c
1 << ADEN ) | ( 1 << ADATE ) | ( 1 << ADPS2 ) | ( 1 << ADPS1 ) ); ADCSRA |= ( 1 << ADSC ); } void PWM_init ( void ) { // Set OC0A/OC0B at bottom and clear OC0A/OC0B at compare match. // Fast PWM with Output Compare Register OCR0A and OCR0B. // No prescaling, voller Systemtakt 8000000Hz. TCCR0A = ( (
in „Digitalverstärker“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
GccApplication3.c
left adjusted ADCSRA |= (1<<ADPS2) | (1<<ADPS0); // ADC-Frequenz Clock/32 (verkürzt die Abfrage) // PWM's PORTB &= ~((1<<PB1) | (1<<PB3)); // alle Ausgänge aus DDRB |= (1<<PB1) | (1<<PB3); // als Ausgänge setzen TCCR1B |= (1<<CS10); // PWM-Mode setzen TCCR1D |= (1<<WGM10); TCCR1D &= ~(1<<WGM11); TCCR1A |= (1<<PWM1A) | (1<<PWM1B) | (1<<COM1A1) | (1<<COM1B1); // Hauptprogrammschleife while(1) { if (!(PINB & (1<<S2))) // wenn S2 beim einschalten gedrückt ist { // gehe in den Programmier-Modus PROG(); } if (!(PINB
in „AVR TTiny 461 Pullup nicht aktiv?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
GccApplication3.c
left adjusted ADCSRA |= (1<<ADPS2) | (1<<ADPS0); // ADC-Frequenz Clock/32 (verkürzt die Abfrage) // PWM's PORTB &= ~((1<<PB1) | (1<<PB3)); // alle Ausgänge aus DDRB |= (1<<PB1) | (1<<PB3); // als Ausgänge setzen TCCR1B |= (1<<CS10); // PWM-Mode setzen TCCR1D |= (1<<WGM10); TCCR1D &= ~(1<<WGM11); TCCR1A |= (1<<PWM1A) | (1<<PWM1B) | (1<<COM1A1) | (1<<COM1B1); // Hauptprogrammschleife while(1) { if (!(PINB & (1<<S2))) // wenn S2 beim einschalten gedrückt ist { // gehe in den Programmier-Modus PROG(); } if (!(PINB
in „AVR TTiny 461 Pullup nicht aktiv?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regler_sensor_lcd.c
TIMER 0 initialisation ****************************************/ //Set Force Output Compare to 0 -> PWM mode******************** TCCR0|=(0<<FOC0); //PWM, Phase Correct******************************************* TCCR0|=(0<<WGM01); TCCR0|=(1<<WGM00); //Clear OC0 on compare match when up-counting. Set OC0
in „LCD Display funktioniert bei Zusammenstellung nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
steuern__ber_HTTP5.ino
<< WGM12) // Mode 14: Fast PWM, TOP = ICR1, Update of OCR1x at BOTTOM, TOV1 Flag Set on TOP | (0 << CS12) | (0 << CS11) | (0 << CS10); // Clock continues to be disabled. Not yet finished configuring. // Ausgangsfrequenz 40kHz // fPWM = fclk_I/O / (N * (1 + TOP)) // fPWM = 16000000 / (1 * (1 + 399)) // fPWM = 20000 Hz ICR1 = 399; // Startwerte Timer1 OCR1A = 250; OCR1B = 0; // Timer1 starten TCCR1B = TCCR1B | (0 << CS12) | (0 <<
in „Inventer Lüfter Ansteuerung“ · Analoge Elektronik und Schaltungstechnik ·
-
PDF
noctua_nf_a14_industrialPPC_3000_pwm_specs_en.pdf
t a c n e s t a c . w Noctua NF-A14 industrialPPC-3000 PWM Product Specifications Version: 1.0 Date: 12.04.2014 Rascom Computerdistribution Ges.m.b.H. Linzer Straße 237 A-1140 Vienna,Austria Tel. +43 (1) 494 13 95 - 0 Fax. +43 (1) 494 13 95 - 10 1. General
in „PWM-Controller ohne Poti aber mit Steuerspannung“ · Analoge Elektronik und Schaltungstechnik ·
-
PDF
S20_EU.SCH.pdf
VDDPST-1 TOUT 6 1 1 1 T1 17 VDDPST-2 F E S 29 VDDD - - R VCC-3V3 E E - VCC_BAR MTMS 9 SCL E MTDI 10 PWM0 16 GPIO4 MTCK 12 PWM1 U6 24 GPIO5 E-CMD 1 CS# VCC 8 MTDO 13 PWM2 27 XTALO GPIO2 14 SDA VCC-3V3 E-D0 2 DO U HOLD# 7 E-D2 28 XTALI GPIO0 15 E-FW 3 VCC_BAR C 6 J1 C E-D3 3 WP# CLK 6 E-CLK E-RX 25 RXD
in „SonOff S20 Leben, wirken und widerbelebung. :-)“ · Haus & Smart Home ·
-
PDF
Simple__C-based_ADCs__Part_1_.pdf
C1 and C2 to equalize 4. Decrement n. Go to 1. Another way to implement a simple DAC is to use a µC PWM output. Filter it through an RC integrator, where the RC time constant is much larger than the PWM switching period. The result is a constant voltage with slight PWM ripple. The PWM DAC speed is limited
in „Frage zu kapazitiven Sensoren“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
hello_world.c
TCCR1A |= (1<<WGM11); //---------------------------- TCCR1B |=((1<<WGM12) | (1<<WGM13)); //--------PWM als fast-Mode PWM konfg TCCR1B |= (1<<CS11); //Taktvorteiler 8 TCNT0=0; /****************************************/ ////////////////////ADC//////////////////// ADMUX|= (1<<MUX1); ADMUX|=(1<<REFS0);//
in „zwei ADC zeigen dasselbe an“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
baseTimerD.h
) * - Glitch free, phase correct Pulse Width Modulator (PWM) * - Variable PWM Period * - Frequency generator * - Three independent interrupt sources (TOV0, OCF0A, and OCF0B) * (*) Allows clocking from external 32kHz watch crystal independent * of the I/O clock
in „Knoten im Kopf, Klassen und Vererbung“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
USB_Programmer_V3.pdf
Multi-Programmer IC Programmer, LogicAnalyzer, Oscilloscope, UARTAnalysis, Voltmeter, Signal Generator, PWM Generator, Logic Testing E-mail:pcb8051@gmail.com 1 USB Multi- Programmer is a development tool of eight functional modules, programmer , logic test, voltmeter, signal generator, PWM generators, logic
in „USB Programmer für unter 15€“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
iWatt-IW1817-00-datasheet.pdf
iW1817 Product Brief Off-Line Digital Green-Mode PWM Controller Integrated with Power BJT 1.0 Features 2.0 Description ●● Tight constant voltage and constant current regulation The iW1817 is a high performance with PrimAccurate™ primary-side-only feedback
in „Welcher Schaltregler IC ist das? 50VDC Input möglich?“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
main.cpp
LED_TYPE == 0 // Classic SuperMini blue LED is active-low (LOW = on). We drive brightness // via LEDC PWM on this channel. static constexpr bool LED_ACTIVE_LOW = true; static constexpr int LED_PWM_FREQ = 5000; static constexpr int LED_PWM_RES_BITS = 8; #endif // Nordic UART Service UUIDs (de-facto standard
-
PDF
SG3525_AppNote.pdf
anoscillatorwhichgeneratesbothaclocksignaland ference is implemented by a mask option which a linear ramp waveform, a PWM comparator, and a eliminatesinverterQ 4 (seefigure3)fortheSG1527A. toggle flip-flop with outputgatingto switchthe PWM Inall otherrespects,the 1525Aand 1527Aareiden- signal alternately between the two
in „SG3525 synchronisieren“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
STM32F10xxx_TIM_application_examples.pdf
a PWM signal with a frequency equal to 36 kHz and a duty cycle equal to 12.5%: TIM3_CH4 duty cycle = TIM3_CCR4/ (TIM3_ARR + 1) × 100 = 12.5% The PWM waveform can be displayed using an oscilloscope. This firmware
in „STM32 Verwirrung o.O (Timer->CCRx)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dcc_lok.lst
---------------------------------------------------------------- 765/ 14 : 00 CV055: BYT $00 ; (+) PWM for FL f/r, phase 00-07 766/ 15 : FF BYT $FF ; (+) PWM for FL f/r, phase 08-0B 767/ 16 : FF BYT $FF ; (+) PWM for FL f/r, phase 0C-0D 768/ 17 : FF BYT $FF ; (+) PWM for FL f/r, phase 0E 769/ 18 : FF BYT $FF ; (+) PWM for FL f/r, phase 0F 770/ 19 : 00 CV060: BYT $00 ; (+) PWM for F8-F1, phase 00-07 771/ 1A : FF BYT $FF ; (+) PWM for F8-F1, phase 08-0B 772/ 1B : FF BYT $FF ; (+) PWM for F8-F1, phase 0C-0D 773/ 1C
in „DCC Singal auslesen“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
The-ESP8266-Book-August-2015.pdf
for each channel can be changed using the pwm_set_period() and pwm_set_duty() functions. Page 95 See also: • Wikipedia: Pulse-width modulation • pwm_init • pwm_start pwm_set_duty • pwm_get_duty • pwm_set_period • pwm_get_period Analog to digital
in „ESP8266 Freies eBook August 2015 'Kolban'“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Eigen_Fahrregler.bas
wieder herausgeschoben. 'Ein Strobe_Signal an PD3 übergibt das obere Byte an den Timer0, der eine PWM 'realisiert. Das untere Byte wird an Port B ausgegeben. An PD5 erscheint das PWM 'Signal, an PD4 und PD6 werden die Steuersignale für eine H-Brücke ausgegeben. 'Die Richtungsinformation liegt im Bit
in „Bit nachschieben oder Bitfolge füllen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
dmx_channel_rx_count < 514) { dmx_channel_rx_count++; } return; } } ISR (TIMER0_COMPA_vect) { static unsigned char pwm_counter = 0; pwm_counter++; if(pwm_counter == 255) { pwm_counter = 0; } if(pwm_counter >= led_kanal[1]) { LED_G_OFF; } else { LED_G_ON; } if(dmx_lost<DMX_LOST_TIMEOUT) { dmx_lost++; } } //Hauptprogramm
in „DMX und der Attiny2313“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
fptest4.asm
******************************************************************** ;* * ;* Testprogramm variable PWM * ;* * ;* Controller: 8515 Clock = 4 MHz * ;* * ;* * ;* Stand: 4.5.03 * ;* PWM Variabel, Problem: Jittern in Frequenz * ;* * ;* * ;*******************************************************************
-
Datei
Unterprogramme.h
Abtastzeit"...in welchen Abständen gemessen wird //Motor-Konstanten: #define OFF 0 //Motor aus für PWM #define FullSpeedLINKS 1023 //Motor ein für PWM #define FullSpeedRECHTS 1023 //Motor ein für PWM #define HalfSpeedLINKS 512 //Motor halbe Kraft #define HalfSpeedRECHTS 512 //Motor halbe Kraft #define
in „Linefollower: I-Anteil wählen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
{ if (direction == LTR) { for(uint8_t led=0;led<amount;led++) { for(uint8_t bri=0;bri<32;bri++) { pwm_setting[pgm_read_byte(patchtable+led)] = pgm_read_byte(pwmtable+bri); // pwm_setting[patchtable[led]] = pwmtable[bri]; _delay_ms(DELAY_FADE); } _delay_ms(DELAY_LED); } } else { for(uint8_t led=amount
in „Treppenstufenbeluchtung - Code Umbauen - Hilfe“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
color.green = f; color.blue = 1; // computed values would be 0 } } int main( void ) { DDRB = 0xff; // Init pwm: // FastPwmMode -> ATMEGA8!!!! pwm 8bit -> only 2 16 bit // channels avail and we want to drive 3 leds... // TCCR1A COM1A1 COM1A0 COM1B1 COM1B0 FOC1A FOC1B WGM11 WGM10 // | | | | | | | +--> Waveform
in „HSV zu RGB mit PWM ausgegeben. Code-Beispiel“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PICboard.c
to the chosen delaytime } //-------------------------------------------------------------------- ///pwm initialization void PWM_init(void) { TOUTPS3 = 0; //Set the postscaler to 1:8 TOUTPS2 = 1; TOUTPS1 = 1; TOUTPS0 = 1; TMR2ON = 1; //Timer 2 on T2CKPS1 = 0; //Set the prescaler to 4 T2CKPS0 = 1; PR2 = 99; //Maximum pwm value = 99; 100 = vcc; 0 = gnd TMR2IF = 0; //Clear timer 2 interrupt flag CCPR1L = 0; //Set no start value CCP1X = 0; CCP1Y = 0; CCP1M2 = 1; //Set the timer to pwm mode CCP1M3 = 1; } //-------------
in „PIC Interrupt blockieren Hauptprogramm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
/* testprogramm for generating a PWM - Singal */ // Microcontroller ATTINY44A #include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #include "AttinyPWM.h" #include "Typedef.h" #define divider 1 volatile uint8_t pwm_flag
in „PWM mit Interrupts steuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
V9.bas
hilfsvariable_int = ShiftRight(dcc_daten_byte, dcc_daten_bit) dcc_senden = hilfsvariable_int.0 Case 3 'Analog (PWM) 6.2kHz If analog_fahrstufe > 0 Then 'analog Fahren If analog_pwm Then hilfsvariable_int = ShiftLeft(analog_fahrstufe, 1) TMR0 = hilfsvariable_int Else 'damit 34us Durchlaufzeit INT: 'TMR0 = 255 - (