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
  • 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. 

     

Reply
  • 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. 

     

Children
  • 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.