Datum: 21.02.2008 17:27
phyCORE-XC167 with XC167CI
Abdeslam Salik
Hallo
I work with a phyCORE-XC167 with XC167CI (16).
IÂ'generetead PWM (CAPCOM6),
so
I have the timer T12 Stopped
So that I can given the frequency for T12
I give the period
Then I set the Output CC60 and COUT60
Then i giving the Value to compared
And finally , I started the timer T12
####################
####################
//Programm
// #########
sbit P1L_0 = P1L^0 ; // declare portpin to use
sbit DP1L_0 = DP1L^0 ; // declare direction bit to use
sbit P1L_1 = P1L^1 ;
sbit DP1L_1 = DP1L^1 ;
void main (void) {
DP1L_0 = 1 ; //init Direction to output
DP1L_1 = 1 ; //init Direction to output
//PWM Konfiguration
CCU6_TCTR0 = 0x0010 ; // T12 ist gestoppt
CCU6_T12PR = 800; //Die Periode der Timer
CCU6_TCTR0 = 0x0009; //T12PRE=1 und T12CLK=001
CCU6_T12MSEL = 0x0003; //Compare output on pins COUT6x and CC6x.
CCU6_TCTR4 = 0x0002 ; // Start the Timer
while(1) // endlosschleife
{
CCU6_T12 = 400; // Count value to compared
} }
#################
#################
but i have no reaction in the Output ?
Thanks in advance
Many thanks for your help
Datum: 26.02.2008 21:34
Hello, you have a mistake in your "think-chain" with CCU6_T12 = 400; you set the value of the Timer T12 The CapCom does it work with a running timer. When the timer compares with the value in the corresponding register. Every output has its own register with names like CCU6_CC6xR (x=1,2,3).
Antwort schreiben
Die Angabe einer Email-Adresse ist freiwillig. Wenn Sie automatisch per Email über Antworten auf Ihren Beitrag informiert werden möchten, melden Sie sich bitte an.
Wichtige Regeln - erst lesen, dann posten!
- Suchfunktion und Betreffsuche benutzen - vielleicht gibt es schon einen ähnlichen Beitrag
- Aussagekräftigen Betreff wählen
- Im Betreff angeben um welchen Controllertyp es geht (AVR, PIC, ...)
- Groß- und Kleinschreibung verwenden
- Längeren Sourcecode nicht im Text einfügen, sondern als Dateianhang
- JPEG-Dateien (.jpg) nur für Fotos und Scans verwenden
- Schaltpläne, Screenshots usw. als PNG oder GIF anhängen
Formatierung (mehr Informationen...)
- [c]C-Code[/c]
- [avrasm]AVR-Assembler-Code[/avrasm]
- [pre]vorformatierter Text (z.B. Code in anderen Sprachen)[/pre]
- [math]Formel in LaTeX-Syntax[/math]
- [[Titel]] - Link zu Artikel