CrazyEngineers
  • Need help with firmware code..

    JAIHO

    JAIHO

    @jaiho-Hz9Ulk
    Updated: Oct 22, 2024
    Views: 880
    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.
    <a href="https://www.keil.com/dd/docs/datashts/silabs/c8051f33x.pdf" target="_blank" rel="nofollow noopener noreferrer">PDF</a>

    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
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register