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

Unable to configure Port 1 as input.

Dear Team,

Greetings,

I am facing a problem for configuring Port 1 as input. I have connected a push button on P1.4 and an led on P0.0. I want to perform a simple task, i.e. when I press button then LED must turn on, else LED must be off. I have used NRF24LE1, 32 pin package.

#include "reg24le1.h"

void main()
{
	P0DIR = 0x00;  // set PORT0 as output
	P1DIR = 0xff;  // set PORT1 as input
	while(1)  // infinite loop
	{
		if (P1 == 0x10)     // check P1.4 is high
		{
			P0 = 0x01;
		}
		else
		{
			P0 = 0x00;
		}
	}
}

Parents Reply
  • Hi,

     

    Is the nRF24LE1 device in "flash mode" (PROG pin high), or something like this (see chapter 6.3.5 in the nRF24LE1 ps for the pins the FSPI uses) ? Is your programmer properly disconnected, and the nRF power cycled after you test this?

    I haven't used that programmer, so I do not have any knowledge on how it works. Do you have a nRFGo motherboard available to program with to see if the behavior is the same here?

      

    Nitesh Dubey said:
    then only P1.0 and P0.4-P0.7

     Do you mean P1.4-P1.7? Note that the nRF24LE1 QFN32 doesn't have P1.7 (it goes up to P1.6)

     

    Kind regards,

    Håkon

Children
Related