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
You are here: Home / Topics / sbit????

sbit????

|

Microcontroller › 8051 › sbit????

  • This topic has 2 replies, 3 voices, and was last updated 10 years, 8 months ago by Dexter.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 28, 2011 at 5:35 am #1343
    Eli
    Participant

    guyz  i wanted to ask what is sbit?.whatt does this mean sbit rd= port^4;

    October 29, 2011 at 3:42 am #6756
    nikhiljain
    Participant

    sbit is a type of  datatype similar to char, integer etc. It is used when we want to use a single bit. In the statement you have given above, it means you have created a bit type variable with name “rd” and whose value will be equal to 5th pin as referenced by the variable port. If port =P0 it means 5th pin of P0.

    November 25, 2011 at 12:37 am #6876
    Dexter
    Participant

    The sbit type defines a bit within a special function register (SFR). It is used in one of the following ways:

    sbit name = sfr-name ^ bit-position;
    sbit name = sfr-address ^ bit-position;
    sbit name = sbit-address;

    sbit    LED2=P3^3;        //……meanspin 3 of port 3 is named as LED2 (USED IN PROGRAM LATER)
    sbit    EN=P3^7;        //…….meanspin 7 of port 3 is named as EN (USED IN PROGRAM LATER)
    sbit    RW=P3^6;        //……………….
    sbit    RS=P3^5;        //……………….

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

RSS Recent Posts

  • Can I use an SPDT 5 wire Relay in reverse? August 9, 2022
  • Basic questions about MOSFETS, Gate Drivers and Diodes August 9, 2022
  • LTSpice DC-AC August 9, 2022
  • Circuit Problem August 8, 2022
  • Google translate suggest "device sheet" or "apparatus sheet" but that cannot be ? August 8, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

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