This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

will nrf24le1 impossible to design a low stanby remote controller ?

I meet problems:

  1. how to make all IO as input pull up??? like

P0DIR=0xFF;

P1DIR=0xFF;

P0CON = 0x50;

P0CON = 0x51;

..........??

how can I make all pins pull up? it seems only one pin can be pull up.

  1. how can I enable all pins wake up when LOW? the key will connect pin to GND when pressed.

    OPMCON= 0x00; // unlock needed?

     WUOPC0 = 0XFF;//
    
     WUOPC1 = 0XFF;//
                                  
     OPMCON = 0x06;// lock?
    
  2. how to enter standby? like following?

    PWRDWN = 0x04;

     delay(100);
     ................
    
  3. is read the pin value like this?

unsigned char pin0value= P0;

unsigned char pin1value= P1;

the pin value I read is in change(not pull up all pins sucessfully?)

This is a simple function but I still can not make it working.......... so please help.

Parents
  • void main(void) { P0DIR = 0xff; P1DIR = 0x3f; PWRDWN = 0; OPMCON= 0x00; P1CON = 0x50;
    P1CON = 0x51;
    P1CON = 0x52;
    P1CON = 0x53;
    P1CON = 0x54;
    P1CON = 0x55;
    P0CON = 0x50;
    P0CON = 0x51;
    P0CON = 0x52;
    P0CON = 0x53;
    P0CON = 0x54;
    P0CON = 0x55;
    P0CON = 0x56;
    P0CON = 0x57;

    	rf_init();								                       
     	EA=1;  
    	LED1=1;
    	delay(50);
    
    	TX_Mode();								
    	while (!(TX_DS|MAX_RT));				
    	sta = 0;
    	PD_Mode();							
    	delay(50);
    	
    	LED1=0;   
        WUOPC0 = 0XFF; 
        WUOPC1 = 0X3F;                            
        OPMCON = 0x06;
    	PWRDWN = 0x01;
     	while(1);
    

    }

    also I ve try folowing code:

    void main(void) { P0 = 0x00; P1 = 0x00; P0DIR = 0xff; P1DIR = 0x3f; PWRDWN = 0; OPMCON= 0x00; P1CON = 0x50;
    P1CON = 0x51;
    P1CON = 0x52;
    P1CON = 0x53;
    P1CON = 0x54;
    P1CON = 0x55;
    P0CON = 0x50;
    P0CON = 0x51;
    P0CON = 0x52;
    P0CON = 0x53;
    P0CON = 0x54;
    P0CON = 0x55;
    P0CON = 0x56;
    P0CON = 0x57;
    LED1=1; delay(500);

    LED1=0;   
        WUOPC0 = 0XFF; 
        WUOPC1 = 0X3F;                            
        OPMCON = 0x06;
    PWRDWN = 0x01;
     	while(1);
    

    }

    it also failed to enter sleep

  • WUOPCx will only enable the pins as a wake up source, but not change the active value for the reset. All pins are by default (once configured by WUOPCx) active high. Some of them can be set to active low. Please have a look in table 65 in the nRF24LE1 product specification.

    So you can't use all buttons as wake up source if they are configured to pull a pin LOW to wake up the chip. Some of these pins can do this, but it's a subset of the pins.

Reply
  • WUOPCx will only enable the pins as a wake up source, but not change the active value for the reset. All pins are by default (once configured by WUOPCx) active high. Some of them can be set to active low. Please have a look in table 65 in the nRF24LE1 product specification.

    So you can't use all buttons as wake up source if they are configured to pull a pin LOW to wake up the chip. Some of these pins can do this, but it's a subset of the pins.

Children
No Data
Related