robismyname
Full Member level 6
- Joined
- Jan 17, 2008
- Messages
- 390
- Helped
- 11
- Reputation
- 22
- Reaction score
- 9
- Trophy points
- 1,298
- Location
- Central Florida
- Activity points
- 4,603
xbr2 = 0xc0
I just want to execute a simple routine using the c8051F120 MCU. I attempted to open port 2 and then enable the crossbar so that my 8 leds hooked up to the port can glow. using this code:
include <c8051F120.h> // SFR declarations
void InitPort()
{
XBR2 = 0xD8; // Enable crossbar and weak pull-up
P2MDOUT |= 0xFF;
}
void main()
{
InitPort();
}
Well it doesn't work!:x
As a sanity check (salvage my self esteem) I attempted to use the c8051F005 MCU and open port 2 and then enable the crossbar so that my 8 leds hooked up to the port can glow. using this code:
#include <c8051F000.h>
void InitPort()
{
XBR2 = 0x40;
PRT2CF |= 0xFF;
}
void main()
{
InitPort();
}
and it worked!
Can anyone help me identify the subtle differences between the two MCU's that are preventing me from succesfully opening the c8051F120 port2?
One thing I noticed and implemented was that (XBR2.4) has to be set to a logic 1 for the 120.
data sheet and such for the c8051f120
https://www.silabs.com/pages/search.aspx?k=C8051F120&searchtypeid=1
data sheet and such for the c8051f005
https://www.silabs.com/pages/search.aspx?k=C8051F005&searchtypeid=1
I just want to execute a simple routine using the c8051F120 MCU. I attempted to open port 2 and then enable the crossbar so that my 8 leds hooked up to the port can glow. using this code:
include <c8051F120.h> // SFR declarations
void InitPort()
{
XBR2 = 0xD8; // Enable crossbar and weak pull-up
P2MDOUT |= 0xFF;
}
void main()
{
InitPort();
}
Well it doesn't work!:x
As a sanity check (salvage my self esteem) I attempted to use the c8051F005 MCU and open port 2 and then enable the crossbar so that my 8 leds hooked up to the port can glow. using this code:
#include <c8051F000.h>
void InitPort()
{
XBR2 = 0x40;
PRT2CF |= 0xFF;
}
void main()
{
InitPort();
}
and it worked!
Can anyone help me identify the subtle differences between the two MCU's that are preventing me from succesfully opening the c8051F120 port2?
One thing I noticed and implemented was that (XBR2.4) has to be set to a logic 1 for the 120.
data sheet and such for the c8051f120
https://www.silabs.com/pages/search.aspx?k=C8051F120&searchtypeid=1
data sheet and such for the c8051f005
https://www.silabs.com/pages/search.aspx?k=C8051F005&searchtypeid=1