Need Urgent help ! , C++ code to Initialize ports on 8051 microcon
I need some help immediately with initializing ports on a 8051 microcontroller.
I am working at this electronics engineering company as a operations manger and I would like to step up to becoming an engineer ( that's what i graduated in ) - But unfortunately due to financial and other reasons I had to take this job , at this engineering company and have to work my way up . .
My boss just gave me an assignment to "Initialize the ports on the 8051 microcontroller , using C++" AND I told him I can do it, but I have no idea how to do it .
Can you help me please??
I have the data sheet and everything ( <a href="https://www.keil.com/dd/docs/datashts/silabs/c8051f33x.pdf" target="_blank" rel="nofollow noopener noreferrer">PDF</a>)
Someone already helped me with few lines of the code ..
P0 = 0x0F ; write to port
var = P0 ; reads the port into a char variable
Pin0 = 1 ; set port 0 pin 0 bit to 1
bit = Pin0 ; reads port 0 pin 0 into bit
P0MDIN = 0xFF ; setting to 1's
P0MDOUT = 0xFF ; push pull
P0SKIP = 0xFF ; setting port 0 to skip
XBR1 |= 0X40 ; setting xbare bit in XBR1 register
I looked at the data sheet and it seemed to make sense to me..But could you help me finish it please? I am trying to move up within in the company..
There are 3 ports in total -( p0, p1, p2 )