1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Serial comm between uC and PC...

Discussion in 'Microcontrollers' started by koolguy, Apr 26, 2013.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Are you sure you have a 20Mhz crystal... It seems as the baud is out....
     
  2. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    yes, kds20.000 and 12 //15pf capacitor...
     
  3. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    I am not getting setting option in debugger
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9

    I found one thing more when i short rx and tx it work fine and show 'a' in sequence...........
     
    • Like Like x 1
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Well its there... Fle/Debugger/Settings...
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Here is my project WITH UART stimulas.
     

    Attached Files:

  8. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    anyway, i have figure out the main cause of problem it was wrong parameter mention on usb module as i said when i short both terminal it work after that i have removed the rx wire from uC and changed tx to tx pin of usb module then it work fine there is no error..............
     
  9. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    I am not getting how to do can you post screen shot?
     
  10. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Thanks Mr. Rogers for the great help....!!
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Do you still need a screen shot!!!
     
  12. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    yes from where to open the uart graph like oscilloscope??
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    First start the debugger.
    first.png
    Choose MPSim
    The output window gains a tab..
    second.png
    Then go back to the debugger menu and "Settings" is at the bottom.
    third.png

    Finally open the UART I/O tab.
    forth.png

    Now you can choose a register injection file to use for input ( The serial.txt file is in the zip file )
    And choose output to window.

    NOTICE** The stimulus file has "wait" parameters as the input is FAR too fast for serial polling...
     
  14. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Hi,

    I am working more on UART passing string and not suck with if cond to do a task......
    the problem is that when any key is press it work not follow the cond , why??
    Code (text):

    if(ch=='a');
    {

    f =  'a' ;
         HSerout(f);
    __delay_ms(250);
     
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Can you re-phrase this, I don't understand your problem...
     
  16. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    OK, I ask a stupid question and end the sentence with "why", why??

    Mike.
     
    • Like Like x 2
  17. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    OK, I am trying to make condition based transmission from let say if 'A' is pressed in keyboard it wil show "jhdghgk" and if 'B' is pressed it should show "kjyhjkdqwefjgtjk" like this....
    but the problem is that when i do this on pressing any of key it work but it should match the key to condition then it should show the result this is what i am asking...
     
  18. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    [MODNOTE]Deleted Off Topic[/MODNOTE]
     
    Last edited by a moderator: May 24, 2013
  19. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    What do you want why you always disturb?
     
  20. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    [MODNOTE]Deleted Off Topic[/MODNOTE]
     
    Last edited by a moderator: May 24, 2013
  21. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    If you want to help then please tell what the problem why if cond is not tested?
     

Share This Page