Skip to content

Commit 19d947d

Browse files
authored
Add files via upload
Init commit.
1 parent 830db8d commit 19d947d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+10400
-0
lines changed

Dz60Dev/C_Layout.hwl

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
OPEN source 0 0 60 39
2+
Source < attributes MARKS off
3+
OPEN assembly 60 0 40 31
4+
Assembly < attributes ADR on,CODE off,ABSADR on,SYMB off,TOPPC 0xF88C
5+
OPEN procedure 0 39 60 17
6+
Procedure < attributes VALUES on,TYPES off
7+
OPEN register 60 31 40 25
8+
Register < attributes FORMAT AUTO,COMPLEMENT None
9+
OPEN memory 60 56 40 22
10+
Memory < attributes FORMAT hex,COMPLEMENT None,WORD 1,ASC on,ADR on,ADDRESS 0x80
11+
OPEN data 0 56 60 22
12+
Data:1 < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16
13+
OPEN data 0 78 60 22
14+
Data:2 < attributes SCOPE local,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16
15+
OPEN command 60 78 40 22
16+
Command < attributes CACHESIZE 1000
17+
bckcolor 50331647
18+
font 'Courier New' 9 BLACK
19+
AUTOSIZE on
20+
ACTIVATE Data:2 Command Procedure Data:1 Source Register Assembly Memory

Dz60Dev/Default.mem

161 Bytes
Binary file not shown.

Dz60Dev/HCS08_OpenSourceBDM.ini

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[Environment Variables]
2+
GENPATH={Project}Sources;{Compiler}lib\hc08c\device\src;{Compiler}lib\hc08c\device\include;{Compiler}lib\hc08c\device\asm_include;{Compiler}lib\hc08c\src;{Compiler}lib\hc08c\include;{Compiler}lib\hc08c\lib
3+
LIBPATH={Compiler}lib\hc08c\device\include;{Compiler}lib\hc08c\include
4+
OBJPATH={Project}bin
5+
TEXTPATH={Project}bin
6+
ABSPATH={Project}bin
7+
8+
[HI-WAVE]
9+
Target=HCS08OpenSourceBDM
10+
Layout=C_layout.hwl
11+
LoadDialogOptions=AUTOERASEANDFLASH RUNANDSTOPAFTERLOAD="main"
12+
MainFrame=2,3,-32000,-32000,-1,-1,130,130,1090,611
13+
TOOLBAR=57600 57601 32795 0 57635 57634 57637 0 57671 57669 0 32777 32776 32782 32780 32781 32778 0 32806
14+
AEFWarningDialog=FALSE
15+
16+
17+
18+
19+
[HCS08 Open Source BDM]
20+
COMSETTINGS=SETCOMM DRIVER NOPROTOCOL NOPERIODICAL
21+
NV_PARAMETER_FILE=
22+
NV_SAVE_WSP=0
23+
NV_AUTO_ID=1
24+
25+
26+
27+
28+
[HCS08 Open Source BDM_GDI_SETTINGS]
29+
CMDFILE0=CMDFILE STARTUP ON ".\cmd\HCS08_OpenSourceBDM_startup.cmd"
30+
CMDFILE1=CMDFILE RESET ON ".\cmd\HCS08_OpenSourceBDM_reset.cmd"
31+
CMDFILE2=CMDFILE PRELOAD ON ".\cmd\HCS08_OpenSourceBDM_preload.cmd"
32+
CMDFILE3=CMDFILE POSTLOAD ON ".\cmd\HCS08_OpenSourceBDM_postload.cmd"
33+
CMDFILE4=CMDFILE UNSECURE ON ".\cmd\HCS08_OpenSourceBDM_Erase_Unsecure.cmd"
34+
MCUID=0x1027
35+
36+
CMDFILE5=CMDFILE VPPON ON "vppon.cmd"
37+
CMDFILE6=CMDFILE VPPOFF ON "vppoff.cmd"
38+
CHIPSECURE=CHIPSECURE SETUP 0xFFBF 0x3 0x2
39+
HCS08DBGMODULEADR=0x1810
40+
DBG0=DBG GENERAL DISARM_ON PROTECT_OFF ANALYZE_ON STEPATRUN_ON
41+
DBG1=DBG PREDEFINED SELECT 0
42+
DBG2=DBG PREDEFINED DBGENGINE END STOP 0x0
43+
DBG3=DBG USER 0x0 0x0
44+
NV_PARAMETER_FILE=C:\Program Files (x86)\Freescale\CodeWarrior for Microcontrollers V6.3\prog\FPP\mcu1027.fpp
45+
NV_SAVE_WSP=0
46+
NV_AUTO_ID=1

Dz60Dev/Sources/Comm/gtypes.h

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef GTYPES_H
2+
#define GTYPES_H
3+
4+
typedef unsigned char uint8_T;
5+
6+
#endif
7+

Dz60Dev/Sources/RTC/RTC.c

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#include "RTC.h"
2+
3+
/*
4+
By Grey, first written at night in 2017-10-26.
5+
*/
6+
void RTC_initialize(void)
7+
{
8+
/**
9+
* V0.1.0
10+
* 2017/11/19 Grey
11+
* Change the source of RTC to ERCLK.
12+
* */
13+
RTCSC_RTCLKS = 0b01;
14+
15+
/* Real-time interrupt requests are enabled. */
16+
RTCSC_RTIE = 1;
17+
18+
/**
19+
* V0.1.0
20+
* 2017/11/19 Grey
21+
* Number 14 will set a counter for 10^5. This would be 0.025s timer setting for a 4MHz clock.
22+
* Number 12 will set a counter for 5ms when using a 4MHz clock.
23+
* */
24+
RTCSC_RTCPS = 12;
25+
26+
}
27+
28+
void interrupt VectorNumber_Vrtc RTC_ISR(void)
29+
{
30+
/* a counter for 5ms */
31+
static uint8_T counter5Ms = 0;
32+
33+
/* Clear the interrupt flag */
34+
RTCSC_RTIF = 1;
35+
36+
counter5Ms += 1;
37+
38+
if(counter5Ms == 2)
39+
{
40+
task_counter += 1U;
41+
Task10ms();
42+
counter5Ms = 0;
43+
}
44+
else
45+
{
46+
/* no code */
47+
}
48+
49+
if(task_counter % 2U == 1U)
50+
{
51+
Task20ms();
52+
}
53+
54+
if(task_counter == 10U)
55+
{
56+
Task100ms();
57+
task_counter = 0U;
58+
}
59+
}
60+
61+

Dz60Dev/Sources/RTC/RTC.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef RTC_H
2+
#define RTC_H
3+
4+
#include <hidef.h> /* for EnableInterrupts macro */
5+
#include "derivative.h" /* include peripheral declarations */
6+
#include "mc9s08dz60.h"
7+
#include "RTC_Data.h"
8+
#include "gtypes.h"
9+
#include "Task.h"
10+
11+
extern void RTC_initialize(void);
12+
extern void interrupt VectorNumber_Vrtc RTC_ISR(void);
13+
14+
15+
#endif
16+

Dz60Dev/Sources/RTC/RTC_Data.c

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "gtypes.h"
2+
3+
uint8_T task_counter = 0U;
4+

Dz60Dev/Sources/RTC/RTC_Data.h

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef RTC_DATA_H
2+
#define RTC_DATA_H
3+
4+
#include "gtypes.h"
5+
6+
extern uint8_T task_counter;
7+
8+
#endif
9+

Dz60Dev/Sources/STDTYPES.H

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
/*****************************************************/
2+
/**
3+
* @file stdtypes.h
4+
* ANSI-C library: standard type typedefs
5+
* defines some usefull stuff not in the
6+
* official ANSI library
7+
*/
8+
/*----------------------------------------------------
9+
Copyright (c) Metrowerks, Basel, Switzerland
10+
All rights reserved
11+
Do not modify!
12+
*****************************************************/
13+
14+
#ifndef _H_STDTYPES_
15+
#define _H_STDTYPES_
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(__HIWARE__)
22+
#define __CAN_HANDLE_LONG_LONG__
23+
/*!< We accept 'long long' types. */
24+
#endif
25+
26+
typedef void (*PROC)(void);
27+
/*!< Parameterless function pointer (Procedure variable) */
28+
29+
#if defined(__CHAR_IS_8BIT__)
30+
typedef unsigned char Byte;
31+
typedef signed char sByte;
32+
#elif defined(__SHORT_IS_8BIT__)
33+
typedef unsigned short Byte;
34+
typedef signed short sByte;
35+
#elif defined(__INT_IS_8BIT__)
36+
typedef unsigned int Byte;
37+
typedef signed int sByte;
38+
#elif defined(__LONG_IS_8BIT__)
39+
typedef unsigned long Byte;
40+
typedef signed long sByte;
41+
#elif defined(__LONG_LONG_IS_8BIT__)
42+
typedef unsigned long long Byte;
43+
typedef signed long long sByte;
44+
#else /* default */
45+
typedef unsigned char Byte;
46+
typedef signed char sByte;
47+
#endif
48+
/*! \typedef Byte
49+
Byte is a unsigned integral 8 bit type (typically unsigned char) */
50+
/*! \typedef sByte
51+
sByte is a signed integral 8 bit type (typically signed char) */
52+
53+
54+
#if defined(__CHAR_IS_16BIT__)
55+
typedef unsigned char Word;
56+
typedef signed char sWord;
57+
#elif defined(__SHORT_IS_16BIT__) && !defined(__INT_IS_16BIT__)
58+
typedef unsigned short Word;
59+
typedef signed short sWord;
60+
#elif defined(__INT_IS_16BIT__)
61+
typedef unsigned int Word;
62+
typedef signed int sWord;
63+
#elif defined(__LONG_IS_16BIT__)
64+
typedef unsigned long Word;
65+
typedef signed long sWord;
66+
#elif defined(__LONG_LONG_IS_16BIT__)
67+
typedef unsigned long long Word;
68+
typedef signed long long sWord;
69+
#else
70+
typedef unsigned short Word;
71+
typedef signed short sWord;
72+
#endif
73+
/*! \typedef Word
74+
Word is a unsigned integral 16 bit type (typically unsigned short) */
75+
/*! \typedef sWord
76+
sWord is a signed integral 16 bit type (typically signed short) */
77+
78+
#if defined(__CHAR_IS_32BIT__)
79+
typedef unsigned char LWord;
80+
typedef signed char sLWord;
81+
#elif defined(__SHORT_IS_32BIT__)
82+
typedef unsigned short LWord;
83+
typedef signed short sLWord;
84+
#elif defined(__INT_IS_32BIT__)
85+
typedef unsigned int LWord;
86+
typedef signed int sLWord;
87+
#elif defined(__LONG_IS_32BIT__)
88+
typedef unsigned long LWord;
89+
typedef signed long sLWord;
90+
#elif defined(__LONG_LONG_IS_32BIT__)
91+
typedef unsigned long long LWord;
92+
typedef signed long long sLWord;
93+
#else /* default */
94+
typedef unsigned long LWord;
95+
typedef signed long sLWord;
96+
#endif
97+
/*! \typedef LWord
98+
LWord is a unsigned integral 32 bit type (typically unsigned int or unsigned long) */
99+
/*! \typedef sLWord
100+
sLWord is a signed integral 32 bit type (typically signed int or signed long) */
101+
102+
typedef unsigned char uchar;
103+
/*!< Definition for an unsigned char. */
104+
typedef unsigned int uint;
105+
/*!< Definition for an unsigned int. */
106+
typedef unsigned long ulong;
107+
/*!< Definition for an unsigned long. */
108+
#ifdef __CAN_HANDLE_LONG_LONG__
109+
typedef unsigned long long ullong;
110+
/*!< Definition for an unsigned long long. */
111+
#endif
112+
113+
typedef signed char schar;
114+
/*!< Definition for an signed char. */
115+
typedef signed int sint;
116+
/*!< Definition for an signed int. */
117+
typedef signed long slong;
118+
/*!< Definition for an signed long. */
119+
#ifdef __CAN_HANDLE_LONG_LONG__
120+
typedef signed long long sllong;
121+
/*!< Definition for an signed long long. */
122+
#endif
123+
124+
/** Defines the enum_t type. */
125+
#if defined(__ENUM_IS_8BIT__)
126+
#if defined(__ENUM_IS_UNSIGNED__)
127+
typedef Byte enum_t;
128+
#elif defined(__ENUM_IS_SIGNED__)
129+
typedef sByte enum_t;
130+
#else
131+
#error "illegal sign of enum"
132+
#endif
133+
#elif defined(__ENUM_IS_16BIT__)
134+
#if defined(__ENUM_IS_UNSIGNED__)
135+
typedef Word enum_t;
136+
#elif defined(__ENUM_IS_SIGNED__)
137+
typedef sWord enum_t;
138+
#else
139+
#error "illegal sign of enum"
140+
#endif
141+
#elif defined(__ENUM_IS_32BIT__)
142+
#if defined(__ENUM_IS_UNSIGNED__)
143+
typedef LWord enum_t;
144+
#elif defined(__ENUM_IS_SIGNED__)
145+
typedef sLWord enum_t;
146+
#else
147+
#error "illegal sign of enum"
148+
#endif
149+
#else /* default */
150+
typedef sWord enum_t;
151+
#endif
152+
153+
typedef int Bool;
154+
/*!< Definition for boolean type. */
155+
#ifdef __MISRA__ /* MISRA rule #18 */
156+
#define TRUE 1u
157+
/*!< Definitioni for TRUE. */
158+
#define FALSE 0u
159+
/*!< Definition for FALSE. */
160+
#else
161+
#define TRUE 1
162+
/*!< Definitioni for TRUE. */
163+
#define FALSE 0
164+
/*!< Definition for FALSE. */
165+
#endif
166+
167+
#ifdef __cplusplus
168+
}
169+
#endif
170+
171+
#endif
172+
/*****************************************************/
173+
/* end stdtypes.h */

0 commit comments

Comments
 (0)