Hi,
for a speed-controll of a single-phase DC Motor I evaluate the Infineon C167CS-LM on the EvalBoard KitCON-167 from Phytec, with two 256KB RAM and two 1MB Flash Moduls.
Working with the Hands-On Training material I used DAvE to create the code for the GPT1.
In the Startup-File Start167.A66 I changed the following registers fitting the Memory: - BUSCON0 = 0x04AF - BUSCON1 = 0x04AF - ADDRSEL1 = 0x0006
The Target setup under uVison3 is the following: - ROM 0x0 - 0x4000 - RAM 0x40000 - 0x44000 (does that work for Debugging?) - Monitor: Phytec KC 167CR (cant find CS?!!) @COM1, 9600 Baud - 8H-0BH, 0ACH-0AFH reserved - (...)
The timer are initialised in gpt1.c as: - T2/T4 as reload for T3 (depending on Toggle Latch) - T3 in timer mode with alternate output P3.3
An connected Oscilloscope detects only noise but no pulses.
I am also wondering why all the registers of the timers and the counters itsself are displayed as "0" when I debug after a stop (peripherals menu).
This is my main.c:
#include "MAIN.H" void MAIN_vInit(void) { GPT1_vInit(); PSW_IEN = 1; } void main(void) { MAIN_vInit(); while(1) {}; }
and my gpt1.c
#include "MAIN.H" void GPT1_vInit(void) { T3CON = 0x0201; // load timer 3 control register T3 = 0x0000; // load timer 3 register T2CON = 0x0025; // load timer 2 control register T2 = 0xC000; // load timer 2 register T4CON = 0x0026; // load timer 4 control register T4 = 0x4000; // load timer 4 register P3 = (P3 & ~(uword)0x0008) | 0x0008; //set data register DP3 = (DP3 & ~(uword)0x0008) | 0x0008; //set direction register T3CON_T3R = 1; // timer 3 run bit is set }
What could be wrong?
Thanks for any help! Mathias