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.

bit banding function of LPC4357

Status
Not open for further replies.

lgeorge123

Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
Activity points
1,403
Can someone give me exactly the code of bit banding using LPC4357 set pin 9_5 GPIO5[18] high ?
 

Bit banging I2C and SPI Codes are same for any microcontroller. They bit banging code from saeedsolution.blogspot.com Modify the codes to LPCxxxx code else post LPCxxxx code I will try to add the bit banging code for it.
 

Bit banging I2C and SPI Codes are same for any microcontroller. They bit banging code from saeedsolution.blogspot.com Modify the codes to LPCxxxx code else post LPCxxxx code I will try to add the bit banging code for it.


The OP is referring to Bit Banding, not Bit Banging.

There is a considerable difference between the two.


@lgeorge123

Bit Banding is typically handled by compiler and command line directives, therefore its implementation and utilization is not only highly device dependent it is also highly compiler dependent.

If you are using the KEIL C Compiler, the following maybe of interest:
Reference: **broken link removed**

Reference: **broken link removed**

Using the --bitband command-line option

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* foo.c */
 
typedef struct {
  int i : 1;
  int j : 2;
  int k : 3;
} BB;
 
BB value __attribute__((at(0x20000040))); // Placed object
 
void update_value(void)
{
  value.i = 1;
  value.j = 0;
}
 
/* end of foo.c */



Bit-banding of objects accessed through absolute addresses

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* foo.c */
 
typedef struct {
  int rts : 1;
  int cts : 1;
  unsigned int data;
} uart;
 
#define com2 (*((volatile uart *)0x20002000))
void put_com2(int n)
{
  com2.rts = 1;
  com2.data = n;
}
 
/* end of foo.c */



Reference: **broken link removed**

Unplaced object

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* foo.c */
 
typedef struct {
  int i : 1;
  int j : 2;
  int k : 3;
} BB __attribute__((bitband));
 
BB value; // Unplaced object
 
void update_value(void)
{
  value.i = 1;
  value.j = 0;
}
 
/* end of foo.c */



Placed object

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* foo.c */
 
typedef struct {
  int i : 1;
  int j : 2;
  int k : 3;
} BB __attribute((bitband));
 
BB value __attribute__((at(0x20000040))); // Placed object
 
void update_value(void)
{
  value.i = 1;
  value.j = 0;
}
 
/* end of foo.c */




BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top