element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Microchip
  • Products
  • Manufacturers
  • Microchip
  • More
  • Cancel
Microchip
Forum Have a question? Ask our Microchip nanoWatt XLP expert!
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Microchip to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 19 replies
  • Subscribers 24 subscribers
  • Views 2228 views
  • Users 0 members are here
  • rishi_vasuki
  • low_power
  • security
  • microchip
  • xlp_mcus
  • smart_sensor
  • power_supplies
  • audio_expert
  • embedded
  • portable_music_player
  • extreme_low_power
  • motor_control
  • suny
Related

Have a question? Ask our Microchip nanoWatt XLP expert!

nlarson
nlarson over 15 years ago

This thread has been closed to new questions.

However, we welcome you to Post Your Question about Test & Measurement in the element14 Community Test & Measurement group. You'll find many fellow members and experts who have just the answer you're looking to find! 

 

Thank You, Your Friends at element14 Community

 

RishiVasuki2.jpg

 

Rishi Vasuki

Rishi has been with Microchip Technology since 2001.  He has experience in developing portable music players and designing a wide variety of embedded applications (audio, security, motor control, power supplies and smart sensor).  His current focus includes PIC(R) XLP MCUs for eXtreme Low Power applications as well as Microchip's mTouch solutions using 8-bit PIC18 & 16-bit PIC24 MCUs.

  • Sign in to reply
  • Cancel
Parents
  • 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 <<Delay1>> 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

       

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • 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 <<Delay1>> 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

       

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Hiya , this sort of question is best answered by our team of engineers at :

     

     

     

    www.microchip.com/support

     

     

     

    Best Regards , Mike

     

     

     

    Mike McGlade  -  Senior Regional Channel Manager - Catalogue

     

    mobile tel: 07713 175760

     

    Skype: mikemcglade

     

      http://www.microchip.com/infodepot

     

     

     

    This thread has been closed to new questions.

    However, we welcome you to Post Your Question about Test & Measurement in the element14 Community Test & Measurement group. You'll find many fellow members and experts who have just the answer you're looking to find! 

     

    Thank You, Your Friends at element14 Community

    Attachments:
    image
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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