GNU ARM汇编--(六)s3c2440的时钟控制
时间:11-26
来源:互联网
点击:
divN_UPLL = 0 UPLL是48M HdivN = 01 PdivN = 1 FCLK : HCLK : PCLK = 1:2:4 datasheet读懂了,写出汇编就很容易了,添加了时钟设置的流水灯如下: [cpp]view plaincopy
- .equGPBCON,0x56000010
- .equGPBDAT,0x56000014
- .equGPB5_out,(1<(5*2))
- .equGPB6_out,(1<(6*2))
- .equGPB7_out,(1<(7*2))
- .equGPB8_out,(1<(8*2))
- .equGPBVALUE,(GPB5_out|GPB6_out|GPB7_out|GPB8_out)
- .equLOCKTIME,0x4c000000
- .equMPLLCON,0x4c000004
- .equUPLLCON,0x4c000008
- .equM_Mdiv,92
- .equM_Pdiv,1
- .equM_Sdiv,1
- .equU_Mdiv,56
- .equU_Pdiv,2
- .equU_Sdiv,2
- .equCLKdivN,0x4c000014
- .equdivN_UPLL,0
- .equHdivN,1
- .equPdivN,1@FCLK:HCLK:PCLK=1:2:4
- .global_main
- _main:
- ldrr0,=GPBCON
- ldrr1,=0x15400
- strr1,[r0]
- @blclock_setup
- ldrr2,=GPBDAT
- ldrr1,=0x1c0
- strr1,[r2]
- bldelay
- ledloop:
- ldrr1,=0x1c0
- strr1,[r2]
- bldelay
- ldrr1,=0x1a0
- strr1,[r2]
- bldelay
- ldrr1,=0x160
- strr1,[r2]
- bldelay
- ldrr1,=0x0e0
- strr1,[r2]
- bldelay
- bledloop
- clock_setup:
- ldrr0,=LOCKTIME
- ldrr1,=0xffffffff
- strr1,[r0]
- ldrr0,=CLKdivN
- ldrr1,=(divN_UPLL<3)|(HdivN<1)|(PdivN<0)
- strr1,[r0]
- ldrr0,=UPLLCON
- ldrr1,=(U_Mdiv<12)|(U_Pdiv<4)|(U_Sdiv<0)@Fin=12MUPLL=48M
- strr1,[r0]
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ldrr0,=MPLLCON
- ldrr1,=(M_Mdiv<12)|(M_Pdiv<4)|(M_Sdiv<0)@Fin=12MFCLK=400M
- strr1,[r0]
- movpc,lr
- delay:
- @ldrr3,=0xffffffff
- ldrr3,=0xfffff
- delay1:
- subr3,r3,#1
- cmpr3,#0x0
- bnedelay1
- movpc,lr
[cpp]view plaincopy
- 在注释掉blclock_setup与不注释的条件对比,流水灯跑的速度明显不一样了.在正确设置时钟后,后面的各个设备模块才可以正确运作.
就写到这里了~~~
ARM汇编s3c2440时钟控 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)