Hi, I'm new to the XC164 and microcontrollers. I'm trying to setup the Capcom6 unit for a 100% PWM output on COUT60, 61 and 62. In debug mode (uVison2) the registers (under Peripherals T12, T13, CAPCOM6) are not updated when I single step my code. Could anyone help me with the right settings? Best regards /Daniel
Hi, I don't know which compiler version You use, but according to Keil, it wasn't possible to simulate the CAPCOM6 unit of the XC16x family at that time and that it would be a part of a software upgrade (April 2003). I haven't tried this update though, so I don't know if it works now. /Daniel
Hi Daniel, the appnotes are quite good, but take care, since the restrictions for 100% and 0% duty cycle are not valid anymore. A better description you cand find in the preliminary version of XC164, where this version is available on the web. CAPCOM6 support for XC16x is planned in KEIL's simulator approx. march/april 2004. You can simulate with old CAPCOM6 simulator dll, but this is tricky and you have translate some registernames to the new one according the manual. zero-match & parallel compare-match --> active state (CC6xR=0) zero-match wo compare match --> passive state (T12=0) A duty cycle of 0% is done as I know with reload of '0' and zero match without compare match enabled for T12. 100% you can reach for my understanding by programming the wished period value + 1 and enabling both matches. For details have a look at peripheral manual. (xc164_um_per_v2.0._2003_12_pre_release) For some other reasons I have 2 examples written for simple edge aligne PWM and center aligned PWM dealing with shadowtransfer. (But not 0% and 100% duty cycle). If you are interested I can share the code. Best regards Stefan
Hi guys, Thanks for the update. I am using uVision 3 with the V5.00 compilier (the latest versions at time of writing). It is not easy to realise that a periferal isn't simulated. The other misleading thing is that the Timer12/CAPCOM6 debug windows don't update on either simulated OR ULINKed processor conditions. I thought I was going mad! The irony is that my code for timer 12 was working all along - To prove this I repeatly read the T12 counter into a variable then watched the variable count up and down in the debug enviroment. This seems to be the only way to debug T12/T13/CAPCOM6 stuff in ULINK for the time being.
Hi Gavin, that's one of the ways. I dealt with old CAPCOM6 (tricky) and if I got it working, I had a little bit more understanding. For debugging purposes I misuse a starterboard with hardwired CAPCOM6 outputs and an oscilloscope to see, whether the signalforms are the expected one or not. For simulation your way is surely more practicable. Stefan
Hello Stefan, can you please provide me the code ? Thank you in advance. My e-Mail: tipscho<at>gmx.de BR
Hi Andreas, I sent you 2 projects for startup. 1 Edge Aligned Mode, 1 Center Aligned Mode. ( Simply output some signals to an oscilloscope ) Stefan