Wednesday, April 24, 2013

S3C6410 learning note

- Timer 4

To make a timer4 module work properly, below have to be configed

TCFG0[23:16] Dead zone length
TCFG0[15:18] Prescaler 1 value for Timer 2,3 and 4
TCFG0[7:0]   Prescaler 0 value for Timer 0 and 1
I don't care the dead zone, so just set-up timer4 prescaler.
Give 0xff00 to TCFG0

TCFG1[19:16] Select Mux input for PWM Timer 4
I don't care the other setting but timer 4, choose 1/16

TCON[22]  Timer4 Auto reload on/off 0:one shot 1: interval mode(auto reload)
TCON[21]  Timer4 manual update, 0:No operation 1:Update TCNTB4
TCON[20]  Timer4 start/stop 0:stop 1:start
timer4 in interval mode,start timer4 give 101 to [22:20]

0x7f006044
TINT_CSTAT[9] Timer4 interrupt status bit. clears by writing '1' on this bit.
(INPORTANT)After every interrupt happen this bit must be clear, so clear this bit must
preform during interrupt occurred.
TINT_CSTAT[4] Timer4 interrupt enable 1: enabled 0:disabled

- Interrupts
use VIC function, 've' flag was set in coprocessor cp15
mrc p15,0,r0,c1,c0,0
orr r0,r0,#(1<<24)
mcr p15,0,r0,c1,c0,0


set all interrupts to irq use VICxINTSELECT to 0
eable int28 use VICxINTENABLE


0x71200f00
VIC0ADDRESS
(INPORTANT)this register must be written a any value after interrupt service has been done

- to be continued

No comments:

Post a Comment