element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum PIC MCU UART
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 302 subscribers
  • Views 292 views
  • Users 0 members are here
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

PIC MCU UART

Former Member
Former Member over 12 years ago

Hi,  I am trying to transmit and recieve block of few bytes through USART. I am using PIC18F452 and PIC18F252 at two kits. I am programming in assembly language. Tranmission is @1200 baud and Procesoor clock @4Mhz.  My problem is,  I cant recieve byte unless insert a delay at transmitter. But it slows the communication. What could be the solution ?  concerned code is copied here. How to speedup the communication eliminating <> between consecutive bytes.  TRANS                        bsf RCSTA,SPEN    ;Enable serial port          bsf RCSTA,CREN    ;cont recieve mode          bsf RCSTA,RX9    ;9'th bit recieve enable                    movlw 0x33              ;for 1200 baud          movwf SPBRG                    bcf TXSTA,BRGH    ;Lo spped baud select          bsf TXSTA,TXEN    ;Transmit enable TXEN-1          bsf TXSTA,TX9    ;9'th bit transmit enable                              movff CMD_T,TXREG    ;byte to transmit          return  ;-----------------------------  TRAX            TX_L      bcf TXSTA,TX9D    ;CLR bit 9      movff PWM_D,CMD_T      call TRANS            call Delay1            TX_H      bsf TXSTA,TX9D    ;set bit 9      movff PWM_V,CMD_T      call TRANS         return   ...  Delay1            movlw    H'FF'      movwf   Dx  L2          movwf     Dy      clrwdt  L1    decfsz    Dy      goto    L1      decfsz  Dx      goto    L2      return  ;;;; recieve iterrupt service routine is .....  ISR_RX         btfss RCSTA,RX9D      goto LB      goto HB        HB     movff RCREG,FDBK_H      goto OVER_RCV        LB    movff RCREG,FDBK_L        OVER_RCV                    retfie        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  • Sign in to reply
  • Cancel
  • i_droppa
    0 i_droppa over 12 years ago

    Hi, do you observe the TRMT bit (Transmit Shift Register Status)? It maybe helps to prevent writing in the TXREG before completed the transmission.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube