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 / transmit a character continuously through PIC 16f688

transmit a character continuously through PIC 16f688

|

Microcontroller › PIC › transmit a character continuously through PIC 16f688

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 4 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 23, 2013 at 6:50 am #2126
    sajjad
    Participant

    hiii

    i have to transmit continuously a character through pic using USART and observe it  on hyper terminal. i am using internal oscillator.

    i am using help  my code is :

     

    void tx_data(unsigned char);
     
    unsigned int i=0;
     
    #define FREQ 8000000    // Frequency = 8MHz
    #define baud 9600
    #define spbrg_value (((FREQ/64)/baud)-1)    // Refer to the formula for Baud rate calculation in Description tab
     
    void main()
    {
        SPBRG=spbrg_value;                                // Fill the SPBRG register to set the Baud Rate
        RCSTA.SPEN=1;                                     // To activate Serial port (TX and RX pins)
      TXSTA.TXEN=1;                                     // To enable transmission
     osccon=0b01110101;                               // using internal oscillator 
      while(1)
        {
            tx_data(‘a’);        // Transmit the same data back to PC
        }
     
     
    }
     
     
    void tx_data(unsigned char data1)
    {
        TXREG=data1;                                     // Store data in Transmit register
        while(PIR1.TXIF==0);                             // Wait until TXIF gets low
    }
     
     
     
    this code is giving output on proteus but not on hardware when i am using MAX232 with terminal.. 
    kindly guide me .
    please tell me the missing or wrong step i am doing.
    thanking in advance 
     

     

    February 24, 2013 at 5:24 pm #9176
    AJISH ALFRED
    Participant

    Please post your circuit diagram.

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

RSS Recent Posts

  • Fun with AI and swordfish basic June 22, 2025
  • Can I make two inputs from one?? June 22, 2025
  • Simple LED Analog Clock Idea June 22, 2025
  • Is AI making embedded software developers more productive? June 22, 2025
  • Behlke swich June 21, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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