340_Lab1_Part2_Cfile

340_Lab1_Part2_Cfile - Tilovon Crite Date void main(void DDRB = 0xff Ports B = output DDRH = 0x00 Ports H = input DDRJ = 2 In order to use Wytec

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// 340_lab1_1 - Part A - tested 6-6-2009 kj // Wytec evb-plus demo board - 24 MHz; Codewarrior 5.9.0 // Inputs DIP-switch states (Port H) and outputs to LEDs (Port //B) // Must set all DIP-switches in "UP" (ungrounded input) //position. .. // . ..before activating hardware RESET to avoid shorted-port //alarm #include <hidef.h> /* common defines and macros */ #include <mc9s12dg256.h> /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dg256b" void delay(); /* ECET - 340 Lab 1 Part2 * Programmers: * Joachim Mekoum * Olutoye Lawrence
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: * Tilovon Crite * Date: October 25, 2010 */ void main(void){ DDRB = 0xff; // Ports B = output DDRH = 0x00; // Ports H = input DDRJ = 2; // In order to use Wytec LEDs set PJ1 = output. .. PTJ = 0; // . .. and reset PJ1 to 0 for(;;) { if(PTH == 1) { PORTB = 0x04; delay(); PORTB = 0x02; delay(); PORTB = 0x01; delay(); } else if (PTH == 2){ PORTB = 0x80; delay(); PORTB = 0x40; delay(); PORTB = 0x20; delay(); } } } void delay() { int i,j; for(i=0; i<1000; i++){ for(j=0; j<1000; j++){ } } }...
View Full Document

This document was uploaded on 04/19/2011.

Page1 / 2

340_Lab1_Part2_Cfile - Tilovon Crite Date void main(void DDRB = 0xff Ports B = output DDRH = 0x00 Ports H = input DDRJ = 2 In order to use Wytec

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online