Need help with firmware code..

I am trying to write a program to initialize General purpose Input Output ports.
The microcontroller I need to initialize the ports on - is a C8051F330 chip.
PDF

I need to write the program in C++.
So far This is what I have .I am stuck and not sure if this is correct or wrong. Any help would mean a lot . Thank you.

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

Replies

You are reading an archived discussion.

Related Posts

I have two dual axis ADXL203 accelerometers. However, I am supposed to get acceleration data in three dimensions. My professor advised me to get dual axis instead of triaxial accelerometers...
I have some acceleration data that I received from an accelerometer and used an A/D converter before sending the data to my computer... how do I use Matlab to integrate...
This Will Do the +,-,*and / of the complex numbers /*Operator overloading for complex Numbers*/ #include #include class complex { float real; float img; public: complex() { real=img=0; } complex(float...
Hello everyone, Please do let me know what you think of the following by clicking on the link --> Theft, Copyright Infringement, File Sharing and Piracy 😁😁😁 Cheers, Suyash
CEans, Quick Heal CEan Of The Month, March '09 is.. 😁Shalini Goel aka CEan - shalini_goel14 😁 *Shalini Wins* Quick Heal Total Security 2009 [10 in 1 protection for PC!]...