This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Design Start ARM Cortex-M0 - UART

Hi,

My professor asked me to do offline processing for signal. I think for that i would only require a processor core, memory and probably a UART.

  I have already built those hardware  from design kit.

I wanted to write  application code(in Keil) for my algorithm which takes data from memory  process it and store it  back into memory.

Since most of the design example(EDK) are in assembly but I m  more familiar with C  but addressing of  peripheral and  starting reset handler routine. I  do not know  how to write in C.   I did not use CMSIS also:(

Could you suggest some  thing which makes it easier

Parents
  • I have defined C as unsigned integer type. I am transferring only 4 unsigned integer values. I checked the UART module. it has a FIFO of depth 16  FIFO  begin Full  may not be the case.

    Could you provide any study material available online for h/w development (verilog part).  I searched on internet not  much is available for building h/w development using cortex M0 IP core. I have implemented few of the design start example. But I am facing difficulty when I interfacing various modules for my requirement.

Reply
  • I have defined C as unsigned integer type. I am transferring only 4 unsigned integer values. I checked the UART module. it has a FIFO of depth 16  FIFO  begin Full  may not be the case.

    Could you provide any study material available online for h/w development (verilog part).  I searched on internet not  much is available for building h/w development using cortex M0 IP core. I have implemented few of the design start example. But I am facing difficulty when I interfacing various modules for my requirement.

Children
  • I am sorry  for above comment not making sense.

    In the above comment. I mean to say. FIFO has depth of 16 so FIFO being full might not be the case.

  • Have you done any simulation to check? Is it not working in simulation? or just hardware?

    There are several areas to check:

    - bus level integration

    - baud rate (how is the system clock divided into the baud rate you expected)? What is the baud rate setting on PC?

    - FPGA pin assignment

    - UART connection (TX data and RX data pin definition on PC and MCU might need a cross over connection)

    - The configuration of UART on your PC. Some PC don't have UART and therefore you might be using a USB to UART adaptor. Have the device driver installed sucessfully? Try a loop back connection to test.

    - TTL to RS232 converter might be needed.

  • Hi,

    I guess most of the things I checked.

    FPGA pin assignment ok.

    -driver of UART  for FPGA installed and also recognized by the PC.

    -tera-term application is intalled as well.

    -As specify the UART  baud rate 19200. GCLK=100Mhz,  HCLK=10MHZ. and baud rate=19200. with (10/19200*16)=32 as count value in baud rate generator.

    In simulation I checked. I guess not worked there. 

     

  • Can you post your program code?

    -          UART registers declarations

    -          How you initialize the UART

    -          The test sequence (how you sent data to UART)

    Thanks

  • For a simple case I just tried to  send a single value as shown.

    #include "stdio.h"

    #define AHB_UART_BASE (*((volatile unsigned long *)(0x51000000)))

    int  main ()

    {

    int a,b,c;

    a=6;

    b=5;

    c=a+b;

    AHB_UART_BASE=c;

    return 0;

    }


    ///Vector table for program. 



    / Define where the top of memory is.

    #define TOP_OF_RAM 0xFFC

    extern int main(void);     // Use C-library initialization function.

    __attribute__ ((section("__Vectors")))

    static void (* const vector_table[])(void) =

    {

      (void (*)(void)) TOP_OF_RAM, // Initial value for stack pointer.

      (void (*)(void)) main,                      // Reset handler is C initialization.

      0,                           // No HardFault handler, just cause lockup.

      0,                           // No NMI handler, just cause lockup.

      0,

      0,

      0,

      0,

      0,

      0,0,0,0,0,0,0//...                       // Additional handlers would be listed here.

      (void) UART_handler

     

    };

  • Sorry for the delay.

    You write the character with value of 11 (0xB) to the UART. However, this might not be a character that can be displayed on your terminal.

    So please try

    AHB_UART_BASE='A'; // Character 'A'

    Another issue is that the main() is finished after you send out the character.

    You might want to add a dead loop :

    int  main (void)

    {

    AHB_UART_BASE='A';

    while(1); // deadloop

    return 0;

    }


    Hope this helps.