MC9S08MP

From emboxit
Jump to: navigation, search


Project

Logistics

1: 	2,43 € 	
25: 	2,09 € 	
50: 	2,02 € 	
100: 	2,00 € 	
500: 	1,94 € 	
1.000:  1,63 €
1: 	1,72 € 	
25: 	1,48 € 	
50: 	1,42 € 	
100: 	1,16 €




Schematics

File:9S08MP16-1.jpg


File:9S08MP16-2.jpg


Blink

<cpp>

  1. define led1 PTED_PTED4
  2. define led2 PTED_PTED3
  3. define BIT_3 0x08
  4. define BIT_4 0x10

unsigned int loopCount;

void main(void) {

 EnableInterrupts; /* enable interrupts */
 /* include your code here */
  PTEDD = PTEDD | BIT_3;
  PTEDD = PTEDD | BIT_4;
  
  led1 = 1;
 for(;;) {
   __RESET_WATCHDOG(); /* feeds the dog */
 loopCount++;
 if (loopCount > 20000){
   loopCount = 0;
   led1 ^=1;  
 }
 } /* loop forever */
 /* please make sure that you never leave main */

} </cpp>