Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to define single bit in MCU 8051 ide?

Status
Not open for further replies.

shadababe04

Newbie level 6
Joined
Jan 17, 2013
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
New Delhi, India, India
Activity points
1,370
how can i define single bit in MCU8051 IDE...?
As i define single bit in Keil just like sbit rs=P1^1; IS not working in MCU 8051 IDE?
 

Have you ever resolved this issue?

Are you still using MCU8051IDE?
 

Code:
#define GPIO_Pin_0                 ((uint16_t)0x0001)  /*!< Pin 0 selected */
#define GPIO_Pin_1                 ((uint16_t)0x0002)  /*!< Pin 1 selected */
#define GPIO_Pin_2                 ((uint16_t)0x0004)  /*!< Pin 2 selected */
#define GPIO_Pin_3                 ((uint16_t)0x0008)  /*!< Pin 3 selected */
#define GPIO_Pin_4                 ((uint16_t)0x0010)  /*!< Pin 4 selected */
#define GPIO_Pin_5                 ((uint16_t)0x0020)  /*!< Pin 5 selected */
#define GPIO_Pin_6                 ((uint16_t)0x0040)  /*!< Pin 6 selected */
#define GPIO_Pin_7                 ((uint16_t)0x0080)  /*!< Pin 7 selected */
#define GPIO_Pin_8                 ((uint16_t)0x0100)  /*!< Pin 8 selected */
#define GPIO_Pin_9                 ((uint16_t)0x0200)  /*!< Pin 9 selected */
#define GPIO_Pin_10                ((uint16_t)0x0400)  /*!< Pin 10 selected */
#define GPIO_Pin_11                ((uint16_t)0x0800)  /*!< Pin 11 selected */
#define GPIO_Pin_12                ((uint16_t)0x1000)  /*!< Pin 12 selected */
#define GPIO_Pin_13                ((uint16_t)0x2000)  /*!< Pin 13 selected */
#define GPIO_Pin_14                ((uint16_t)0x4000)  /*!< Pin 14 selected */
#define GPIO_Pin_15                ((uint16_t)0x8000)  /*!< Pin 15 selected */
#define GPIO_Pin_All               ((uint16_t)0xFFFF)  /*!< All pins selected */
From stm32f10x_gpio.h SPL library
set bit 1: value |= GPIO_Pin_1;
clear bit 1: value &= ~GPIO_Pin_1;
invert bit 1: value ^= GPIO_Pin_1;
 

SDCC has dedicated syntax for bit-addressable SFR, similar to Keil sbit. I don't believe that the ST32 syntax will be understood by the compiler.
 

I believe the post is off-topic here as it doesn't refer to 8051. 8051 has no 32 bit wide SFRs. Please clarify the subject.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top