72 lines
1.7 KiB
C
72 lines
1.7 KiB
C
/* *********************************************** *
|
|
* main.c *
|
|
* 68HC08GR8 Simon's Game Program *
|
|
* ----------------------------------------------- *
|
|
* Created on: 07.12.2022 *
|
|
* Author: q242695 *
|
|
* *********************************************** */
|
|
/* *********************************************** *
|
|
* Pin assignment:
|
|
* ---------------
|
|
* +--\/--+
|
|
* CGMXFC 1|° |28 VSSa
|
|
* OSC2 2| |27 VDDa
|
|
* OSC1 3| |26 PTA3
|
|
* /RST 4| |25 PTA2--> SPEAKER
|
|
* R_BTN-->PTE0 5| |24 PTA1 pgm
|
|
* Y_BTN-->PTE1 6| |23 PTA0 pgm
|
|
* /IRQ 7| |22 VSSad
|
|
* RED <--PTD0 8| |21 VDDad
|
|
* YEL <--PTD1 9| |20 PTB3--> DISP_CLK
|
|
* GREEN<--PTD2 10| |19 PTB2--> DISP_DIO
|
|
* BLUE <--PTD3 11| |18 PTB1 pgm
|
|
* VSS 12| |17 PTB0 pgm
|
|
* VDD 13| |16 PTD6<-- B_BTN
|
|
* LED <--PTD4-14| |15 PTD5<-- G_BTN
|
|
* +------+
|
|
* ************************************************ */
|
|
|
|
#include "mc68hc908gr8.h"
|
|
#define C_DEBOUNCE 10
|
|
|
|
long counter;
|
|
|
|
void delay(void) {
|
|
for(counter=0;counter<10000;) {
|
|
counter++;
|
|
}
|
|
}
|
|
void debounce(void) {
|
|
}
|
|
|
|
unsigned char key_scan(void) {
|
|
return(0);
|
|
}
|
|
|
|
void sound(unsigned char s) {
|
|
}
|
|
|
|
void led_on(unsigned char i) {
|
|
}
|
|
|
|
void random_seq (void) {
|
|
}
|
|
|
|
void display (unsigned char t) {
|
|
}
|
|
|
|
void main (void) {
|
|
// ** Standard OSC Setup **
|
|
CONFIG1_COPD=1; // Disables COP
|
|
PCTL_PLLON=0; // Disables PLL
|
|
|
|
// ** Main Program **
|
|
PTD = 0x00; // The Port will be blanked
|
|
DDRD = 0x1F; // make PTD0..4 output
|
|
for (;;) { // infinite loop
|
|
delay();
|
|
PTD^=0x1F; //toggle PTD0..4
|
|
}
|
|
}
|
|
|