SAMA5: Delay loop calibrated; Correct sense of the RED LED

This commit is contained in:
Gregory Nutt 2013-07-31 11:44:30 -06:00
parent ffdd034c35
commit 0a32db5e05
9 changed files with 59 additions and 22 deletions

View File

@ -449,7 +449,7 @@ Buttons and LEDs
PE24. The red LED is also pulled high but is driven by a transistor so
that it is illuminated when power is applied even if PE24 is not
configured as an output. If PE24 is configured as an output, then the
LCD is illuminated by a low output.
LCD is illuminated by a high output.
These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in
@ -772,8 +772,14 @@ Configurations
CONFIG_BOOT_RUNFROMISRAM=y : Run from internal SRAM
STATUS:
2013-7-19: This configuration (as do the others) run at 396MHz.
The SAMA5D3 can run at 536MHz. I still need to figure out the
PLL settings to get that speed.
2013-7-28: This configuration was verified functional.
2013-7-31: Delay loop calibrated.
norboot:
This is a little program to help debug of code in NOR flash. It
does the following:
@ -788,6 +794,13 @@ Configurations
1. This program derives from the hello configuration. All of the
notes there apply to this configuration as well.
STATUS:
2013-7-19: This configuration (as do the others) run at 396MHz.
The SAMA5D3 can run at 536MHz. I still need to figure out the
PLL settings to get that speed.
2013-7-31: Delay loop calibrated.
nsh:
This configuration directory provide the NuttShell (NSH).
@ -833,13 +846,22 @@ Configurations
However, no built-in applications are selected in the base configuration.
STATUS:
2013-7-19: This configuration (as do the others) run at 396MHz.
The SAMA5D3 can run at 536MHz. I still need to figure out the
PLL settings to get that speed.
2013-7-31: I have been unable to execute this configuration from NOR
FLASH by closing the BMS jumper (J9). As far as I can tell, this
jumper does nothing on my board??? I have been using the norboot
configuration to start the program in NOR FLASH (see just above).
See "Creating and Using NORBOOT" above.
2013-7-31: This NSH configuration appears to be fully functional.
2013-7-31: Using delay loop calibration from the hello configuration.
That configuration runs out of internal SRAM and, as a result, this
configuration needs to be recalibrated.
ostest:
This configuration directory, performs a simple OS test using
examples/ostest.
@ -883,15 +905,22 @@ Configurations
BMS jumper.
STATUS:
2013-7-19: This configuration (as do the others) run at 396MHz.
The SAMA5D3 can run at 536MHz. I still need to figure out the
PLL settings to get that speed.
2013-7-30: I have been unable to execute this configuration from NOR
FLASH by closing the BMS jumper (J9). As far as I can tell, this
jumper does nothing on my board??? I have been using the norboot
configuration to start the program in NOR FLASH (see just above).
See "Creating and Using NORBOOT" above.
2013-7-31:
The OS test configuration is basically functional, but takes a very
long time in the round-robin scheduler test computing prime numbers.
This test is suppose to be slow -- like several seconds -- but not
many minutes. No idea why yet. The best guess would be an excessive
number of context switches.
2013-7-31: The OS test configuration is basically functional, but
takes a very long time in the round-robin scheduler test computing
prime numbers. This test is supposed to be slow -- like several
seconds -- but not many minutes. No idea why yet. The best guess
would be an excessive number of context switches.
2013-7-31: Using delay loop calibration from the hello configuration.
That configuration runs out of internal SRAM and, as a result, this
configuration needs to be recalibrated.

View File

@ -197,7 +197,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_RAM_START=0x00300000
CONFIG_RAM_VSTART=0x00300000

View File

@ -156,7 +156,7 @@
* PE24. The red LED is also pulled high but is driven by a transistor so
* that it is illuminated when power is applied even if PE24 is not
* configured as an output. If PE24 is configured as an output, then the
* LCD is illuminated by a low output.
* LCD is illuminated by a high output.
*/
/* LED index values for use with sam_setled() */

View File

@ -207,7 +207,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0

View File

@ -208,7 +208,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0

View File

@ -208,7 +208,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0

View File

@ -131,8 +131,8 @@ void up_ledinit(void)
void up_ledon(int led)
{
bool blueoff = true;
bool redoff = true;
bool blueoff = true; /* Low illuminates */
bool redon = false; /* High illuminates */
switch (led)
{
@ -148,13 +148,12 @@ void up_ledon(int led)
return;
case 3: /* LED_PANIC */
redoff = false;
redon = true;
break;
}
sam_gpiowrite(GPIO_BLUE, blueoff);
sam_gpiowrite(GPIO_RED, redoff);
sam_gpiowrite(GPIO_RED, redon);
}
/****************************************************************************
@ -165,8 +164,8 @@ void up_ledoff(int led)
{
if (led != 2)
{
sam_gpiowrite(GPIO_BLUE, true);
sam_gpiowrite(GPIO_RED, true);
sam_gpiowrite(GPIO_BLUE, true); /* Low illuminates */
sam_gpiowrite(GPIO_RED, false); /* High illuminates */
}
}

View File

@ -122,10 +122,15 @@ void sam_setled(int led, bool ledon)
if (led == BOARD_BLUE)
{
/* Low illuminates */
ledcfg = GPIO_BLUE;
ledon = !ledon;
}
else if (led == BOARD_RED)
{
/* High illuminates */
ledcfg = GPIO_RED;
}
else
@ -144,9 +149,13 @@ void sam_setleds(uint8_t ledset)
{
bool ledon;
ledon = ((ledset & BOARD_BLUE_BIT) != 0);
/* Low illuminates */
ledon = ((ledset & BOARD_BLUE_BIT) == 0);
sam_gpiowrite(GPIO_BLUE, ledon);
/* High illuminates */
ledon = ((ledset & BOARD_RED_BIT) != 0);
sam_gpiowrite(GPIO_RED, ledon);
}

View File

@ -65,12 +65,12 @@
* PE24. The red LED is also pulled high but is driven by a transistor so
* that it is illuminated when power is applied even if PE24 is not
* configured as an output. If PE24 is configured as an output, then the
* LCD is illuminated by a low output.
* LCD is illuminated by a high output.
*/
#define GPIO_BLUE (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
GPIO_PORT_PIOE | GPIO_PIN25)
#define GPIO_RED (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
#define GPIO_RED (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOE | GPIO_PIN24)
/* Buttons **************************************************************************/