Announcement

Collapse
No announcement yet.

uOLED-160 ACK/NAK Behavoir - STM32L

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ESPsupport
    replied


    Goldelox will lock onto whatever baud rate you send the U at and then will respond at that rate. Of course, if there is a lot of noise on the serial line it could be getting confused.

    Goldelox will be working at 3.3v, it is 5v tolderant. Is it possible your STM32L is not handling this?

    Try communicating using your programming cable and FAT Controller. Then look at it using whatever tools you have available.

    Maybe connect 'half' your STM32L to the display and try sending from Terminal so see which half is not working properly

    Leave a comment:


  • paulleicester
    replied


    I have now increased the time as you have suggested. I now seem to be getting F0 as a result when stepping through with a breakpoint. if I connect via Xbee to the TX i get FF. if I change it back to 750, now I get that result too.

    I wonder if there is something wrong with the baud rate.

    if I change it to 300 (the lowest the screen supports) I get different results.... 0xD5.

    Having different results makes me wonder if maybe the screen is not able to understand or figure out what baud rate I am actually using, for all I know it is sending back a NAK, at the wrong baud rate :S

    hmmm.

    Leave a comment:


  • ESPsupport
    replied


    Try waiting, say, 5 seconds before sending the 'U'. If that works, try reducing the time. 5 Seconds is probably heaps, but I think 750ms mght be a bit short

    Leave a comment:


  • paulleicester
    started a topic uOLED-160 ACK/NAK Behavoir - STM32L

    uOLED-160 ACK/NAK Behavoir - STM32L

    Hey all,

    Ive been really struggling getting this oled to work with my STM32L micro.

    The uOLED TX is connected to my assigned RX pin and the opposite is also true.

    I send 0x55 of which I expect an ACK byte as I do when I connect my Bus Pirate to the OLED, so I wait for it and it never comes, if I connect the OLED' TX pin to the RX of another UART (in this case a xbee) it outputs 0xC0 and 0xCE.

    If I swap out the screen fully with the xbee, I receive the 0x55 and if I reply with 0x06 it works exactly as expected.

    Yet as soon as I mate the screen with my micro (which works at TTL levels) it just does not want to know. The screen definitely recognises something as the splash screen does not show.

    the following code is executed 750ms after power on/reset. do not be worried by my non handling of a NAK that was originally properly handled but I have placed this code for convenience , I am break pointing inside of the loop, which never fires.


    void INIT_Screen (void)
    {
    USART_InitTypeDef USART_InitStructure2;
    GPIO_InitTypeDef GPIO_InitStructure2;
    GPIO_DeInit(GPIOD);
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOD, ENABLE);
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2 , ENABLE);

    GPIO_InitStructure2.GPIO_Mode = GPIO_Mode_AF;
    GPIO_InitStructure2.GPIO_Speed = GPIO_Speed_10MHz;
    GPIO_InitStructure2.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure2.GPIO_PuPd = GPIO_PuPd_UP;
    GPIO_InitStructure2.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6;
    GPIO_Init(GPIOD, &GPIO_InitStructure2);

    GPIO_PinAFConfig(GPIOD, GPIO_PinSource5, GPIO_AF_USART2);
    GPIO_PinAFConfig(GPIOD, GPIO_PinSource6, GPIO_AF_USART2);

    USART_InitStructure2.USART_BaudRate = 9600;
    USART_InitStructure2.USART_WordLength = USART_WordLength_8b;
    USART_InitStructure2.USART_StopBits = USART_StopBits_1;
    USART_InitStructure2.USART_Parity = USART_Parity_No;
    USART_InitStructure2.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
    USART_InitStructure2.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
    USART_Init(USART2, &USART_InitStructure2);

    USART_Cmd(USART2, ENABLE);


    while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == SET) //Clear the RXNE incase anything got there durin init
    {
    if(USART_ReceiveData(USART2) == 0x06) gotACK = 1;
    }
    while(USART_GetFlagStatus(USART2, USART_FLAG_TXE) == RESET);
    USART_SendData(USART2, 0x55);//Tell screen to Auto Baud
    while(USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);
    gotACK = 0;
    while(gotACK == 0){
    while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET);
    while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == SET)
    {
    if(USART_ReceiveData(USART2) == 0x06) gotACK = 1;
    }
    }

    while(USART_GetFlagStatus(USART2, USART_FLAG_TXE) == RESET);

    USART_SendData(USART2, 0x45);//Tell screen to clear
    while(USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);
    gotACK = 0;
    while(gotACK == 0){
    while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET);
    while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == SET)
    {
    if(USART_ReceiveData(USART2) == 0x06) gotACK = 1;
    }
    }
    }



    I wonder if anyone may have experienced similar issues or if anything jumps out to someone as not right with my code.

    Many Thanks

    Paul
Working...
X