phyCORE-XC167 with XC167CI

OP (Firma: Privat) #789595
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
Gast #794914
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

Eine eigene Frage? Dieser Thread ist über 18 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.