We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
As I mentioned before, I never used XC167. Just my (last) 2 cent:
P1 could be already used for the 8/16 bit demux bus. Couldn't that be a problem?
You are loading and starting the timer again and again and again...
Before downloading your application to flash and hoping it runs you should first simulate it.