This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

some troubles with SiLabs c8051f041

Hi!
I have some troubles with SiLabs c8051f041. I try to start very simple program - flashing one led on gpio. I use Keil CA51 Compiler Kit. Program succesfully compilates without errors. Then I program my chip c8051f041 with BeeProg+ programmer. When programming is succesfully finished, I try to power ON my chip. And nothing happened... I don't understand what I am doing wrong?

Parents
  • This is a very, very, very fast blink:

    while (1) {
        P0 |=(1<<7);      //LED ON
        P0 &= ~(1<<7);  //LED OFF
    }
    

    How do you expect to see the LED blink when it is blinking many, many, many times faster than the human eye can see?

    You either need to use an oscilloscope to look at that processor pin, or you need to introduce a delay between on->off and between off->on.

    A pin that quickly toggles between GND and VCC will look like VCC/2 when you measure with a slow multimeter.

    Another thing to remember is that your processor is rather unique and supports single-bit writes to the processor port pins - you can create a one-bit variable mapped to the LED pin and then just assign the value 0 or 1 instead of doing the |= and &= assigns.

Reply
  • This is a very, very, very fast blink:

    while (1) {
        P0 |=(1<<7);      //LED ON
        P0 &= ~(1<<7);  //LED OFF
    }
    

    How do you expect to see the LED blink when it is blinking many, many, many times faster than the human eye can see?

    You either need to use an oscilloscope to look at that processor pin, or you need to introduce a delay between on->off and between off->on.

    A pin that quickly toggles between GND and VCC will look like VCC/2 when you measure with a slow multimeter.

    Another thing to remember is that your processor is rather unique and supports single-bit writes to the processor port pins - you can create a one-bit variable mapped to the LED pin and then just assign the value 0 or 1 instead of doing the |= and &= assigns.

Children