Jump to content

sirbow2

Members
  • Content Count

    11
  • Joined

  • Last visited

About sirbow2

  • Rank
    Member

Contact Methods

  • Website URL
    http://dduino.blogspot.com
  1. sirbow2

    FREE TI Launchpad ... hurry !

    hey trying to be helpful dont be a <what ever you want to use that's insulting> about it.
  2. sirbow2

    FREE TI Launchpad ... hurry !

    maybe you already used it or you already applied it to your order
  3. sirbow2

    FREE TI Launchpad ... hurry !

    i got it too! i got that error too, but IE didnt have except for one and then i just refreshed the page. the ti site was just really slow in general
  4. +1 oh and in the pic, you can see it says 240x320 on the red border
  5. http://forum.arm-hq.com/topic/24-tutorialstm32f0-discovery-keil-ide-setup/
  6. i got mine(F0) for free as a sample
  7. yeah, still not working. strange...
  8. i figured it will be helpful in the future to know how to do this stuff, and not to use "libraries" of some sort. ill try that, thanks yes, i know, one will be on, one will be off when button is pressed, and the opposite if not pressed.
  9. im finally starting to get into the programming of my STM32f0Discovery board and i cant quite get my button to work. code: #include "stm32f0xx.h" int main(void); int main(void){ int i; // Enable clock for GPIOC RCC->AHBENR |= (1 << 19); GPIOC->MODER |= (1 << 16);//Set pin C8 as output GPIOC->OTYPER &= ~(1 << 8);//Set pin 8 output as internal push-pull GPIOC->MODER |= (1 << 18);//Set pin C9 as output GPIOC->OTYPER &= ~(1 << 9);//Set pin 9 output as internal push-pull // enable user PA0 button RCC->AHBENR |= (1 << 17); /* Enable GPIOA clock */ GPIOA->PUPDR |= (1 << 0); /* PA.0 is Pull up */ // GPIOC->BSRR |= (1 << 24);//Turn Pin C8 off // GPIOC->BSRR |= (1 << 8);//Turn C8 on //GPIOC->BSRR |= (1 << 9);//Turn C9 on //GPIOC->BSRR |= (1 << 25);//Turn Pin C9 off while(1) { //This code turns on and off LEDs via the button, cant get this to work. it is always LOW if((GPIOA->IDR & (1 << 0))==(1 << 0)) //read pin state { //High GPIOC->BSRR |= (1 << 8);//Turn C8 on GPIOC->BSRR |= (1 << 25);//Turn Pin C9 off } else { //Low GPIOC->BSRR |= (1 << 9);//Turn C9 on GPIOC->BSRR |= (1 << 24);//Turn Pin C8 off } } } either if((GPIOA->IDR & (1 << 0))==(1 << 0)) isnt properly getting the button value or RCC->AHBENR |= (1 << 17); GPIOA->PUPDR |= (1 << 0); isn't setting up the input correctly. I do know that the LEDs work this code: #include "stm32f0xx.h" int main(void); int main(void){ int i; // Enable clock for GPIOC RCC->AHBENR |= (1 << 19); GPIOC->MODER |= (1 << 16);//Set pin C8 as output GPIOC->OTYPER &= ~(1 << 8);//Set pin 8 output as internal push-pull GPIOC->MODER |= (1 << 18);//Set pin C9 as output GPIOC->OTYPER &= ~(1 << 9);//Set pin 9 output as internal push-pull // enable user PA0 button RCC->AHBENR |= (1 << 17); /* Enable GPIOA clock */ GPIOA->PUPDR |= (1 << 0); /* PA.0 is Pull up */ // GPIOC->BSRR |= (1 << 24);//Turn Pin C8 off // GPIOC->BSRR |= (1 << 8);//Turn C8 on while(1) { //This is the LED blink code- blinks the two LEDs on and off---------------------------------------------------- for(i = 1000000; i >0; i--) { i++; i--; } //A short delay GPIOC->BSRR |= (1 << 9);//Turn C9 on GPIOC->BSRR |= (1 << 24);//Turn Pin C8 off for(i = 1000000; i >0; i--) { i++; i--; } //A short delay GPIOC->BSRR |= (1 << 8);//Turn C8 on GPIOC->BSRR |= (1 << 25);//Turn Pin C9 off } } code from page 129 + or - a few pages: http://www.st.com/in.../DM00031936.pdf
  10. it's not my website, but i can find the right links for it and post them here. do you mean this topic or the "Compilers and IDE" subforum? i think this subforum is good where it's at.
  11. At first i tried to get Eclipse to work for my discovery board, but i couldn't figure it out, so, instead i tried the Keil IDE and have had very few issues since. Here's a quick tutorial: http://dduino.blogsp...very-board.html
×