GNU ARM汇编--(九)s3c2440的PWM
时间:11-26
来源:互联网
点击:
- 90
- .equINTMSK,0x4A000008
- .equEINTPEND,0x560000a8
- .equSUBSRCPND,0x4a000018
- .equINTSUBMSK,0x4a00001c
- .equSRCPND,0X4A000000
- .equINTPND,0X4A000010
- .equGPHCON,0x56000070
- .equGPHDAT,0x56000074
- .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
- .equWTCON,0x53000000
- .equPre_scaler,249
- .equwd_timer,1
- .equclock_select,00@316
- .equint_gen,1@开中断
- .equreset_enable,0@关掉重启信号
- .equWTDAT,0x53000004
- .equCount_reload,50000@定时器定为2SPCLK=100MPCLK/(Pre_scaler+1)/clock_select=100M/(249+1)/16=25k50000/25k=2s
- .equWTCNT,0x53000008
- .equCount,50000
- .equTCFG0,0x51000000
- .equPrescaler1,0x00@[15:8]Timer234
- .equPrescaler0,249@[7:0]Timer01
- .equTCFG1,0x51000004
- .equDMA_MODE,0x0@[23:20]nodmachannal
- .equMUX0,0x2@[3:0]1/8
- @定时器输入时钟周期=PCLK/(prescaler+1)/(dividervalue)
- @clk=100M/(249+1)/8=25k
- .equTCON,0x51000008
- .equDZ_eable,0@[4]关闭死区的操作
- .equauto_reload,1@[3]auto_reload
- .equinverter,1@[2]打开电平反转
- .equman_update,1@[1]手动更新
- .equclear_man_update,0
- .equstart,1@[0]开始
- .equstop,0@[0]停止
- .equTCNTB0,0x5100000c
- .equTCMPB0,0x51000010
- .equTCNTO0,0x51000014
- .equULCON0,0x50000000
- .equIR_MODE,0x0@[6]正常模式
- .equParity_Mode,0x0@[5:3]无校验位
- .equNum_of_stop_bit,0x0@[2]一个停止位
- .equWord_length,0b11@[1:0]8个数据位
- .equUCON0,0x50000004
- .equFCLK_Div,0@[15:12]时钟源选择用PCLK,所以这里用默认值
- .equClk_select,0b00@[11:10]时钟源选择使用PCLK
- .equTx_Int_Type,1@[9]中断请求类型为Level
- .equRx_Int_Type,0@1@[8]中断请求类型为Level
- .equRx_Timeout,0@[7]
- .equRx_Error_Stat_Int,1@[6]
- .equLoopback_Mode,0@[5]正常模式
- .equBreak_Sig,0@[4]不发送终止信号
- .equTx_Mode,0b01@[3:2]中断请求或轮循模式
- .equRx_Mode,0b01@[1:0]中断请求或轮循模式
- .equUFCON0,0x50000008
- .equTx_FIFO_Trig_Level,0b00@[7:6]
- .equRx_FIFO_Trig_Level,0b00@[5:4]
- .equTx_FIFO_Reset,0b0@[2]
- .equRx_FIFO_Reset,0b0@[1]
- .equFIFO_Enable,0b0@[0]非FIFO模式
- .equUMCON0,0x5000000C@这个寄存器可以不管的
- .equUTRSTAT0,0x50000010
- .equUERSTAT0,0x50000014
- .equUFSTAT0,0x50000018
- .equUMSTAT0,0x5000001C
- .equUTXH0,0x50000020@(L小端)
- .equURXH0,0x50000024@(L小端)
- .equUBRdiv0,0x50000028
- .equUBRdiv,0x35@PCLK=400M/4=100MUBRdiv=(int)(100M/115200/16)-1=53=0x35
- .globalBuzzer_Freq_Set
- .global_start
- _start:breset
- ldrpc,_undefined_instruction
- ldrpc,_software_interrupt
- ldrpc,_prefetch_abort
- ldrpc,_data_abort
- ldrpc,_not_used
- @birq
- ldrpc,_irq
- ldrpc,_fiq
- _undefined_instruction:.wordundefined_instruction
- _software_interrupt:.wordsoftware_interrupt
- _prefetch_abort:.wordprefetch_abort
- _data_abort:.worddata_abort
- _not_used:.wordnot_used
- _irq:.wordirq
- _fiq:.wordfiq
- .balignl16,0xdeadbeef
- reset:
- ldrr3,=WTCON
- movr4,#0x0
- strr4,[r3]@disablewatchdog
- ldrr0,=GPBCON
- ldrr1,=0x15400@这个时候暂不配置GPB0为TOUT0,这时候只是配置GPB0为TOUT0
- strr1,[r0]
- ldrr2,=GPBDAT
- ldrr1,=0x160
- strr1,[r2]
- blclock_setup
- bluart_init
- //bldelay
- msrcpsr_c,#0xd2@进入中断模式
- ldrsp,=3072@中断模式的栈指针定义
- msrcpsr_c,#0xd3@进入系统模式
- ldrsp,=4096@设置系统模式的栈指针
- @--------------------------------------------
- ldrr0,=GPBUP
- ldrr1,=0x03f0
- strr1,[r0]
- ldrr0,=GPFCON
- ldrr1,=0x2ea@0x2
- strr1,[r0]
- ldrr0,=EXTINT0
- @ldrr1,=0x8f888@0x0@0x8f888@~(7|(7<4)|(7<8)|(7<16))//低电平触发中断
- ldrr1,=0xafaaa@0x0@0x8f888//下降沿触发中断
- strr1,[r0]
- ldrr0,=EINTPEND
- ldrr1,=0xf0@0b10000
- strr1,[r0]
- ldrr0,=EINTMASK
- ldrr1,=0x00@0b00000
- strr1,[r0]
- ldrr0,=SRCPND
- ldrr1,=0x3ff@0x1@0b11111
- strr1,[r0]
- ldrr0,=SUBSRCPND
- ldrr1,=0x1<13
- strr1,[r0]
- ldrr0,=INTPND
- ldrr1,=0x3ff@0x1@0b11111
- strr1,[r0]
- ldrr0,=INTSUBMSK
- ldrr1,=0x0<13
- strr1,[r0]
- ldrr0,=INTMSK
- ldrr1,=0xfffff000@0b00000
- strr1,[r0]
- MRSr1,cpsr
- BICr1,r1,#0x80
- MSRcpsr_c,r1
- blmain
- irq:
ARM汇编s3c2440PW 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)