/************************************************************* * jl16-0.c - Demonstrate simple I/O functions of MC68HC908JL16 * * Program loops turning PTA0 on and off as fast as possible. * * The program should generate code in the loop consisting of * LOOP: BSET 0,PTA (4 cycles) * BCLR 0,PTA (4 cycles) * BRA LOOP (3 cycles) * * PTA0 will be low for 7 * 4 / OSC1 freq * PTA0 will be high for 4 * 4 / OSC1 freq * A 9.8304MHz clock gives a loop period of about 4.5 microseconds. * * Revision History * Date Author Description * 10/11/06 A. Weber Initial Release * 05/29/07 A. Weber Some editing changes for clarification * 07/09/12 A. Weber Removed code to set security bytes * 05/29/13 A. Weber Renamed CWJL-0.c to jl16-0.c *************************************************************/ #include /* for EnableInterrupts macro */ #include "derivative.h" /* include peripheral declarations */ void main(void) { // EnableInterrupts; /* enable interrupts */ /* include your code here */ CONFIG1_COPD = 1; // disable COP reset DDRA_DDRA0 = 1; // Set PTA bit 0 for output while (1) { // Loop forever PTA_PTA0 = 1; // Set PTA bit 0 to a 1 PTA_PTA0 = 0; // Clear PTA bit 0 to a 0 } /* please make sure that you never leave this function */ }