Hi Volker
If you want to program to FLASH you will have to use the correct linker file (or project). It looks as though the FLASH programmer is trying to FLASH to the RAM range.
When using the PIT you also have to activate the interrupt and set up its priorities correctly. The interrupt vector is correct at vector 77
Here is code which will enable programming the PIT accurately to any range from about 1ms to about 70s. It will generate a periodic tick at this rate. It uses a medium interrupt priority which can be changed if required.
Please see also the following post about the uTasker operating system with integrated TCP/IP stack and real-time device simulator.
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=274It is free for educational and hobby use and comes with complete project code and email support. Most peripheral drivers are available so such problems have already been solved you you.
See for example the Coldfire tutorial containing step for step quide to using the Codewarrior
http://www.mjbc.ch/documents/uTasker/M5223X/uTaskerV1.2-Tutorial-M5223X.PDFRegards
Mark Butcher
www.mjbc.ch /
www.uTasker.comCode:#define TICK_RESOLUTION 1000 // 1 second TICK// Routine to initialise the Real Time Tick interrupt//#define REQUIRED_MS ((1000/TICK_RESOLUTION)) // The TICK frequency we require in kHz#if TICK_RESOLUTION > 4#if TICK_RESOLUTION > 64#define TICK_DIVIDE (((BUS_CLOCK/2/32768) + REQUIRED_MS/2)/REQUIRED_MS) // the divide ratio required (32k prescaler assumed)#define PIT_PRESCALE PIT_PRESCALE_32K#else#define TICK_DIVIDE (((BUS_CLOCK/2/4096) + REQUIRED_MS/2)/REQUIRED_MS) // the divide ratio required (4k prescaler assumed)#define PIT_PRESCALE PIT_PRESCALE_4K#endif#else#define TICK_DIVIDE (((BUS_CLOCK/2/1048) + REQUIRED_MS/2)/REQUIRED_MS) // the divide ratio required (1k prescaler assumed)#define PIT_PRESCALE PIT_PRESCALE_1K#endifextern void fnStartTick(void){PIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD); // prepare for loadPIT_PMR_0 = TICK_DIVIDE; // load interval valueIC_ICR_0_55 = (INTERRUPT_LEVEL_4 | INTERRUPT_PRIORITY_4); // define interrupts level and priorityIC_IMRH_0 &= ~(PIT_0_PIF_INT_H | MASK_ALL_INT); // unmask interrupt sourcePIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD | PIT_PIE | PIT_EN); // start PIT with interrupt enabled}/**************************** Real Time Clock interrupt ******************************************/__interrupt__ void my_timer_irq_handler(void){PIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD | PIT_PIE | PIT_EN); // Reset interrupt request flag// do other stuff here//////} Message Edited by Alban on 2006-09-06 02:23 PM