EFM32 - Set Pin on Input with PullUp / Pin auf Eingang mit PullUp EFM32

OP #2522931
Lesenswert?
• ▲
▼
Hello everybody,

I have got no idea what is wrong with the following code:
All I want to do, is to set a Pin on "input-Mode" with a PullUp, but  if 
I measure the voltage at the Pin, all I get is between 0.4V and 0.5V.
I had expected a Value about ~3.2 V, and so the Interrupt Routine 
doesn't start either.

Do I somehow have destroyed the entrance, or could the mistake be solved 
within the code?


The code is below after the german version of the question:
_____________________

Hallo allerseits,

bin gerade etwas ratlos.
Ich dachte, ich hätte mit meinem Code einen Pin auf Eingang gesetzt und 
den Pulluip aktiviert.

Nachmessen zeigt allerdings, dass nur 0,4 bis 0,5 Volt anliegen.

Hab ich den Eingang irgendwie zerschossen, oder liegt es nur an dem 
Code?

_____________________________


CMU_ClockEnable(cmuClock_GPIO, true);   //GPIO mit Clock verdrahten

GPIO_PinModeSet(gpioPortC, 14, gpioModeInputPull, 1);  //Input with 
PullUp
GPIO_IntConfig(gpioPortC, 14, false, true, true);

NVIC_ClearPendingIRQ(GPIO_EVEN_IRQn);
NVIC_EnableIRQ(GPIO_EVEN_IRQn);



thanks to everyone
allen ein Dankeschön
OP #2523377
Lesenswert?
• ▲
▼
yes it is.

thank all of you for reading this. Sometimes the error is too simple.
I have measured the impedance between the neigbhoured pins and found out 
that it was much too small.
So I took a cotton stick and some acetone and cleaned it up. Now I get 
the desirerd high voltage level of 3.3V...

...but now another error occurs and this is not a hardwareproblem, it 
has to do with the interrupts.


/***************************************/

void SysTick_Handler(void)
{
  msTicks++;       /* incr counter used in Delay()*/
}

/**************************************/
void GPIO_EVEN_IRQHandler(void)
{
  GPIO_IntClear(1 << 14);
}
/**************************************/
void Delay(uint32_t dlyTicks)
{
  uint32_t curTicks;

  curTicks = msTicks;
  while ((msTicks - curTicks) < dlyTicks) ;
}
/**************************************/

// Taster Pin PC14 set to Input Falling Edge
void Taster_config(void)
{
  GPIO_PinModeSet(gpioPortC, 14, gpioModeInputPullFilter, 1);
  GPIO_IntConfig(gpioPortC, 14, false, true, true);

  NVIC_ClearPendingIRQ(GPIO_EVEN_IRQn);
  NVIC_EnableIRQ(GPIO_EVEN_IRQn);
}

__________________________________

int main(void)
{
CHIP_Init();
SystemCoreClockUpdate();
if (SysTick_Config(SystemCoreClock / 1000)) while (1) ;

//Clock connect with GPIO Module
CMU_ClockEnable(cmuClock_GPIO, true);

//Benutzer_LED als Push-Pull-Drive mit 0.5 mA einstellen
GPIO_DriveModeSet(gpioPortA, gpioDriveModeLowest);  //0.5 mA 
GPIO_PinModeSet(gpioPortA, 1, gpioModePushPullDrive , 0);

Taster_config();

while(1)
    {
    Delay(500);
    GPIO_PinOutToggle(gpioPortA, 1);

    }//end while(1)
}//end main


So... the programm lights up the LED in 0.5sec and another 0.5 sec. it 
is dark.
Then the programm hang up, wehn the Button PC14 is pressed...

What can I do against this?


Thanks in advance!
#2525123
Lesenswert?
• ▲
▼
Hi

The code seems fine, but I suspect your project settings might be set up 
for the wrong device. If your project includes the startup file for a 
Gecko micro, the interrupt vectors will not match a Tiny Gecko for 
instance. This could cause the kind of error you are experiencing. There 
are some guidelines on how to port a project here:

http://support.energymicro.com/entries/20287387-port-iar-project-from-gecko-to-tiny-gecko

Christian

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.