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

Problem with C8051F120 GPIO

Hi,

I am working on Silabs C8051F120 Microcontroller.

I have written a Interrupt code where I am toggling a pin P1.1 , The code is working fine and pin is toggling after specified period. but when I change the PIN to P7.1 the Toggling doest take place?

Is there anything other that I have to configure ??

Kindly give me u r suggestions,

Rajesh

Parents
  • Different from the C8051F0xx series,the C8051F1xx series issue a paging method to access the increasing number of registers.That is to say,you should keep in mind the SFRPAGE is filled with coresponding value when access any register.

    And specialy,some usual registers can be accessed in all pages,such as P0,P1,P2,P3,SFRPAGE.etc.Otherwise you should assign a correct value to SFRPAGE before do something.

    For example,

        sbit LED=P7^1;
        ...
    //save the current value of SFRPAGE
        unsigned char SFRPAGE_SAVE=SFRPAGE;
    //switch to the page which P4-P7 reside in
        SFRPAGE = 0x0f;
    //toggle it
        LED=~LED;
    //restore the SFRPAGE
        SFRPAGE=SFRPAGE_SAVE;
    

Reply
  • Different from the C8051F0xx series,the C8051F1xx series issue a paging method to access the increasing number of registers.That is to say,you should keep in mind the SFRPAGE is filled with coresponding value when access any register.

    And specialy,some usual registers can be accessed in all pages,such as P0,P1,P2,P3,SFRPAGE.etc.Otherwise you should assign a correct value to SFRPAGE before do something.

    For example,

        sbit LED=P7^1;
        ...
    //save the current value of SFRPAGE
        unsigned char SFRPAGE_SAVE=SFRPAGE;
    //switch to the page which P4-P7 reside in
        SFRPAGE = 0x0f;
    //toggle it
        LED=~LED;
    //restore the SFRPAGE
        SFRPAGE=SFRPAGE_SAVE;
    

Children
  • Thanx Ninja,

    I sloved the problem, there problem now is that I have enabled External memory Interface with Lower Ports, thus I have written a program where the Lower Ports of the external memory where I am just toggling PINS of 8255 in a Infinite loop and in between a Interrupt will toogle of the pin P7.0.

    Now this Pin P7.0 is not toggeling , I dont know why this is not toggling??

    Does External Interface disables all pin operations????

  • Thanx ... I have sloved. it was in SFRPAGE Decleration..,

    I am new to Silabs Microcontroller.., Thanx again for u r support

    Rajesh