汇编stm32

2019-03-23 19:22发布

AREA RESET ,CODE ,READONLY
   DCD 0x12345622
          ENTRY
          mov r0, #1234
          mov r1, #1234  
          mov r2, #1234
          mov r3, #1234
          B .
          END
为什么这一段代码在keil4下运行 寄存器没有变化啊
高手多多指点一下 不甚感激啊 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
1条回答
duzhiming
2019-03-24 04:04
/ void UART_COM2_Init(void)
{   
    GPIO_InitTypeDef           GPIO_InitStructure;
        USART_InitTypeDef      USART_InitStructure;
/*************************************enable——clock*************************************/

        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD|RCC_APB2Periph_AFIO, ENABLE);
    GPIO_PinRemapConfig(GPIO_Remap_USART2,ENABLE);
        RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);

/**************************************管脚配置*************************************/
                 
        USART_InitStructure.USART_BaudRate = 2400;   
        USART_InitStructure.USART_WordLength = USART_WordLength_8b;
        USART_InitStructure.USART_StopBits = USART_StopBits_1;
        USART_InitStructure.USART_Parity = USART_Parity_No;
        USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
          GPIO_Init(GPIOD, &GPIO_InitStructure);  
         
          GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
          GPIO_Init(GPIOD, &GPIO_InitStructure);

        USART_Init(USART2, &USART_InitStructure);
        USART_Cmd(USART2, ENABLE);
}
stm32f107的片子
为什么这里的数据有问题 直接用USART_SendData(USART2,0x12);
输出的不是12 是其他的误码 很奇怪的

[ 本帖最后由 duzhiming 于 2013-1-5 18:01 编辑 ]

一周热门 更多>