RS08KA2 PROMO Freescale Semiconductor, RS08KA2 PROMO Datasheet - Page 25

DEMO KIT, SILICON BUNDLE, RS08KA2

RS08KA2 PROMO

Manufacturer Part Number
RS08KA2 PROMO
Description
DEMO KIT, SILICON BUNDLE, RS08KA2
Manufacturer
Freescale Semiconductor
Datasheet

Specifications of RS08KA2 PROMO

Kit Contents
DEMO9RS08KA2 Board, USB Cable, Quick Start Guide, User Manual, Packing List
Svhc
No SVHC (15-Dec-2010)
Development Tool Type
Demonstration Kit
Kit Features
RS08KA2 Microcontroller,
Silicon Manufacturer
Freescale
Core Architecture
RS08
Core Sub-architecture
RS08
Silicon Core Number
MC9RS08
Silicon Family Name
RS08KA
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
;=========================================================================
; Application Definition
;=========================================================================
RC
mRC
TableStart
; variable/data section
SensorReading
ADCOut
;-------------------------------------------------------
; Init RAM
;-------------------------------------------------------
;-------------------------------------------------------
; Config GPIO
; RC - init L
;-------------------------------------------------------
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; Read Sensor (ADC) Value
; Timer prescalar=8 -> Timer clk~250kHz
; Bus = 2MHz
; Max OF period = 1.02ms
; Timer resolution = 4us
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ADCRead:
Freescale Semiconductor
b) Comparator positive terminal must be initialized as output low, so that RC network will start
c) In the ADCRead subroutine, the timer is initialized and started to run before enabling the
org
clr
clr
mov
mov
mov
mov
mov
mov
bset
wait
mov
brclr
up at a completely discharged state. Coding is shown below:
comparator. Once the comparator is enabled, both of its terminals become analog inputs and
the RC network starts to charge up. The MCU then enters wait mode and waiting for interrupt
events to trigger. Both timer (MTIM) overflow interrupt and comparator interrupt are enabled
since either of these events will wake the MCU up from wait mode. When an interrupt triggers
the software flow continues and the following instruction is executed. The timer counter value
is read out immediately and save in SensorReading variable. The comparator flag is then
checked. If it is clear, it indicates no comparator event occurred. The ADC input could be out
of range and the saved SensorReading value is flushed. Otherwise the comparator is disabled,
the positive terminal returns to output low and discharges the RC network.
equ
equ
equ
Tiny_RAMStart
ds.b 1
ds.b 1
SensorReading
ADCOut
#(mDATAOUT), PTAD
#(mRC|mDATAOUT), PTADD
#(MTIM_BUS_CLK|MTIM_DIV_8), MTIM1CLK
#255, MTIM1MOD
#(mMTIM1SC_TRST|mMTIM1SC_TOIE), MTIM1SC
#(mACMP1SC_ACME|mACMP1SC_ACIE|ACMP_OUTPUT_RAISING), ACMP1SC
ACMP1SC_ACF, ACMP1SC
MTIM1CNT, SensorReading
ACMP1SC_ACF, ACMP1SC, NoReading
PTAD_PTAD0
mPTAD_PTAD0
$3E00
Getting Started with RS08, Rev. 1
; Single byte instruction
; Single byte instruction
; RC Initial low
; Set Output pins
;Change Timer resolution
;OF period
;Reset and Start Timer
; Enable ACMP, start RC rise
;Clear ACMP Flag
Emulated ADC Application Example
25

Related parts for RS08KA2 PROMO