uart program for aduc7026

Discussion in 'Embedded Systems and Microcontrollers' started by satishreddy, Sep 28, 2012.

  1. satishreddy

    Thread Starter New Member

    Jul 19, 2012
    6
    0
    hello,
    iam trying to communicate on hyperterminal from aduc7026 board but iam receiving some bad character on hyper terminal.SO PLEASE help me to come out of problem.program is shown below

    Code ( (Unknown Language)):
    1.  
    2. #include<aduc7026.h>
    3. void init_uart(void);
    4. int main()
    5. {
    6. static int i;
    7. unsigned char c[]="HELLO";
    8. init_uart();
    9. for(i=0;i<5;i++)
    10. {
    11. while((COMSTA & TEMT)==0)
    12. COMTX=c[i];
    13. }
    14.  
    15. void init_uart(void);
    16. {
    17. COMCON=0x80;
    18. COMDIV0=0x93;
    19. COMDIV1=0x00;
    20. COMCON=0x03:
    21. }
    22. [/i]
     
    Last edited by a moderator: Sep 28, 2012
  2. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    Very often the problem is caused by incorrect baud rate.
    Have you checked the baud rate?
    Are you using an external xtal?
    Do you have an oscilloscope to check the baud rate?
    Why transmit "HELLO"?
    To check the baud rate on the oscilloscope I send a single character "U" with a delay between each character transmission.
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Does the board have a logic to RS232 level converter? But I agree most often garbled transmission on RS232 are caused by wrong baud rate. But also sometimes wrong parity settings
     
Loading...