EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Sending data serially to pc

Sending data serially to pc

|

Microcontroller › AVR › Sending data serially to pc

  • This topic has 3 replies, 3 voices, and was last updated 13 years, 9 months ago by AJISH ALFRED.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 11, 2012 at 2:27 pm #1874
    Ghulam Mustafa
    Participant

    Hello, 
    i am new to AVR. Currently working on Atmega16. I want to transmit data with maximum possible rate to PC serially. 
    Getting help from avr book by mazidi, i have written the following code for my controller. 


    Code:
    .INCLUDE “M16DEF.INC” 
    LDI R16, HIGH(RAMEND) 
    OUT SPH,R16 
    LDI R16, LOW(RAMEND) 
    OUT SPL,R16 

    LDI R16,(1<<TXEN) 
    OUT UCSRB, R16 
    LDI R16,(1<<UCSZ1)|(1<<UCSZ0)|(1<<URSEL) 
    OUT UCSRC, R16 
    LDI R16, 0x33 
    OUT UBRRL,R16 

    AGAIN: 
    LDI R17,’Y’ 
    CALL TRNSMT 
    LDI R17,’E’ 
    CALL TRNSMT 
    LDI R17,’S’ 
    CALL TRNSMT 
    LDI R17,’ ‘ 
    CALL TRNSMT 
    RJMP AGAIN 

    TRNSMT: 
    SBIS UCSRA,UDRE 
    RJMP TRNSMT 
    OUT UDR,R17 
    RET 



    The fuse bits are set to high byte D9 low byte FF 
    i am using 8 Mhz crystal with 22 capacitor. 

    I have tried a lot but not receiving data on the hyperterminal, pls guide me. 
    Also connecting the osciloscope probe on the txd pin pulses are seen there. 
    Thanks

    July 11, 2012 at 3:23 pm #8237
    Amrith
    Participant

    Gulham,

    Using osciloscope, check the data at tx pin of MAX232. If you find data at tx pin of MAX232, there might be some thing wrong in baudrate. Try lowering the baudrate.

    July 11, 2012 at 6:04 pm #8243
    Ghulam Mustafa
    Participant

    wysiwyg_imageupload:5410:

    wysiwyg_imageupload:5411:wysiwyg_imageupload:5412:

    July 11, 2012 at 8:32 pm #8246
    AJISH ALFRED
    Participant

     

    have you did the loopback test with your serial port of pc? connect a db9 connector, short pin 2 and 3, type something and the same should be received in hyperterminal

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • ANOTHER OLD PROJECT REDO April 16, 2026
  • EasyEda program has a major bug April 16, 2026
  • How to set the OSCAL in a PIC 12F675 April 16, 2026
  • issues with level shifter driving a CGHV1A250F April 15, 2026
  • Drawing software April 15, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise