This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

phyCORE-XC167 with XC!67CI

Hallo
Ich arbeite mit einem phyCORE-XC167 with XC167CI
Ich will ein einfachen PWM erzeugen an den Port_1 an den Pin P1L_0 und P1L_1 (Patch Field 40D und 40B).
1:
aber wenn Ich mein Programm starte ohnen die Port konfiguration ,und auf den mic lade , ist keine Reaktion an die Pins
2:
wenn ich die mein Programm mit der Port konfiguration compiliere ,kriege ich diese Meldung vom Copiler ( error C25 syntax error near 'sbit')

Ich will eigentlich nur das PWM verhalten an die Pins anschauen wenn ich die Periode andere oder die Count value von T12 .
Danke fuer jede Hilfe .
und so sieht mein Programm aus :

#include <XC167.h>

void main (void) {

//Port 1 konfiguration

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;

DP1L_0 = 1; //init Direction to output CC60

DP1L_1 = 1; //init Direction to output COUT60

//PWM Konfiguration

CCU6_TCTR0 = 0x0010; // T12 ist gestoppt
CCU6_TCTR4 = 0x0001; // T12 zaehlt nicht mehr

CCU6_T12 = 400; // Timer Wert mit dem es vergliechen wird
CCU6_T12PR = 800; //Die Periode der Timer
CCU6_TCTR4 = 0x0020 ; // Start der Timer

while(1){

CCU6_T12 = 400; // Timer Wert mit dem es vergliechen wird
CCU6_T12PR = 800; //Die Periode der Timer

}

} end of main

Parents
  • Hello

    So I have the program now finally compiled, and error free.
    Now I have this problem:
    1:
    If I download the hex file with the Flash 3 beta Tolls on the MIC.
    Gives me an Error, "" The spicified Area is not blank "." Although I have the chip removed "erase chip." What is the reason?
    The target is to be set
    ROM 0x0 to 0x100000
    RAM 0x200000 to 0x80000

    2:
    Welsche problem you see in my program? What do you see is wrong with my program?

    Many thanks for your help

    ####################
    ####################
    //Programm

    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_TCTR4 = 0x0001 ; // T12 zählt nicht mehr

    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.

    while(1) // endlosschleife

    {
    CCU6_T12 = 400; // Timer Wert mit dem es vergliechen wird
    CCU6_TCTR4 = 0x0002 ; // Start der Timer
    } }

Reply
  • Hello

    So I have the program now finally compiled, and error free.
    Now I have this problem:
    1:
    If I download the hex file with the Flash 3 beta Tolls on the MIC.
    Gives me an Error, "" The spicified Area is not blank "." Although I have the chip removed "erase chip." What is the reason?
    The target is to be set
    ROM 0x0 to 0x100000
    RAM 0x200000 to 0x80000

    2:
    Welsche problem you see in my program? What do you see is wrong with my program?

    Many thanks for your help

    ####################
    ####################
    //Programm

    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_TCTR4 = 0x0001 ; // T12 zählt nicht mehr

    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.

    while(1) // endlosschleife

    {
    CCU6_T12 = 400; // Timer Wert mit dem es vergliechen wird
    CCU6_TCTR4 = 0x0002 ; // Start der Timer
    } }

Children
No data