Jump to content

atomsoft

Members
  • Content Count

    15
  • Joined

  • Last visited

  • Days Won

    1
  1. No problem. I have a F0 board as well. Ill try with that one. I use the CP2102 for USB to UART... its cheaper and works just as good if not better I know this doesnt apply here but since its apart of the GRBL: http://www.indiegogo.com/AtomCNC?a=776492&i=wdgi
  2. great question. I was waiting for someone to ask that. Its just controlling the AVR... but i do have plans to port the GRBL to this ARM board.
  3. More info will be posted here. Its basically a control for a cnc machine using GRBL as the controller. http://www.shapeoko....70&p=2960#p2960
  4. Yeah, ive been using Dorkbot through email for months already... first time using the site ...
  5. atomsoft

    Hey!

    Ah ok i had to make sure. Yeah i do dabble in it but very little. I have a raspberry pi coming in soon too! So expect me to post on that also
  6. Looks pretty cool but only 48MHz i like the STM32F4 since it can reach 168MHz
  7. Yeah, but i ordered about 2 weeks ago and got 1 set out of 2 in the mail today slower than usual.
  8. atomsoft

    Hey!

    Thanks guys, 1st... liter.. you are 100% right Best quality for price 2nd... bluehash... ill be sure to add the links... just been going nuts back and forth...then lunch ... BB is BeagleBoard ?
  9. void ConfigUSART2(uint32_t BAUD, uint32_t apbclock) { uint32_t tmpreg = 0x00; uint32_t integerdivider = 0x00; uint32_t fractionaldivider = 0x00; RCC->APB1ENR = (1 << 17); //Enable USART2 Clock GPIOD->MODER |= (2 << 10); //Setup TX pin for Alternate Function GPIOD->MODER |= (2 << 12); //Setup RX pin for Alternate Function GPIOD->AFR[0] |= (7 << 20); //Setup TX as the Alternate Function GPIOD->AFR[0] |= (7 << 24); //Setup RX as the Alternate Function USART2->CR1 |= (1 << 13); //Enable USART integerdivider = ((25 * apbclock) / (2 * (BAUD))); tmpreg = (integerdivider / 100) << 4; fractionaldivider = integerdivider - (100 * (tmpreg >> 4)); tmpreg |= ((((fractionaldivider * 8) + 50) / 100)) & ((uint8_t)0x07); USART2->BRR = (uint16_t)tmpreg; USART2->CR1 |= (3 << 2); //Enable Tx & Rx } Basic Functions: void putchar(USART_TypeDef* myUSART, uint32_t data) { myUSART->DR = (char)data; while(((myUSART->SR >> 6) & 0x01) == 0); } void putstr(USART_TypeDef* myUSART, char *data) { while(*data) putchar(myUSART,*data++); }
  10. #include <stm32f4xx.h> #define ALL_GPIO 0x1FF #define LED 15 void main(void) { RCC->AHB1ENR = ALL_GPIO; GPIOD->MODER |= (1 << (LED * 2));//OUTPUT GPIOD->OSPEEDR |= (0x02 << (LED * 2));//50MHz GPIOD->PUPDR &= (0x03 << (LED * 2)); //Set it for NO PUPD GPIOD->BSRRL |= (1<<LED); while(1) { } }
  11. /********************************************************************** GPIO Mode Register - GPIOx->MODER 00 = INPUT 01 = OUTPUT 10 = ALTERNATE FUNCTION 11 = ANALOG Example: Make LED pin output **********************************************************************/ #define LED 3 GPIOx->MODER |= (1 << (LED * 2)); //Set to Output /********************************************************************** GPIO Type Register - GPIOx->OTYPER 0 = PUSH-PULL (default) 1 = Open Drain Example: Make LED pin push-pull type **********************************************************************/ #define LED 3 GPIOx->OTYPER &= !(1 << LED); //Set to Push-Pull /********************************************************************** GPIO Output Speed Register - GPIOx->OSPEEDR 00 = 2MHz (Low Speed) 01 = 25MHz (Med. Speed) 10 = 50MHz (Fast Speed) 11 = 100MHz/80MHz (High Speed)(100MHz(30pf) - 80MHz(15pf)) Example: Make LED pin 100MHz **********************************************************************/ #define LED 3 GPIOx->OSPEEDR |= (0x02 << (LED * 2)); //Set Max of 50MHz Speed /********************************************************************** GPIO Pull-Up / Pull-Down Register - GPIOx->PUPDR 00 = No Pull-Up / No Pull-Down 01 = Pull-Up Enabled 10 = Pull-Down Enabled 11 = Reserved Example: LED pin with NO PU/PD **********************************************************************/ #define LED 3 GPIOx->PUPDR |= (0x03 << (LED * 2)); //Set it for NO PUPD /********************************************************************** GPIO Input Data Register - GPIOx->IDR Read Pin State Example: Get input from button **********************************************************************/ #define BTN 2 variable = ((GPIOx->IDR >> BTN) & 1); //Get Button State /********************************************************************** GPIO Output Data Register - GPIOx->ODR Write Pin State Example: Turn on LED **********************************************************************/ #define LED 3 GPIOx->ODR |= (1<<LED); //Turn on LED /********************************************************************** GPIO Bit Set/Reset Register - GPIOx->BSRRn n = H (RESET) n = L (SET) Set or Reset Pins Example: Turn LED On then Off **********************************************************************/ #define LED 3 GPIOx->BSRRL |= (1<<LED); //Turn On LED GPIOx->BSRRH |= (1<<LED); //Turn Off LED /********************************************************************** RCC AHB1 peripheral clock register (RCC_AHB1ENR)(5.3.10 in REF MAN) BIT H = ON BIT L = OFF Example: Enable all GPIO Clocks (A:I) **********************************************************************/ #define ALL_GPIO 0x1FF RCC->AHB1ENR = ALL_GPIO; GPIO Funtion: void ConfigPin(GPIO_TypeDef *myGPIO, uint32_t PIN, uint32_t MODE, uint32_t SPEED, uint32_t PUPD) { /* myGPIO: The GPIOx port for the selected pin MODE: 0 = INPUT .... 1 = OUTPUT .... 2 = ALTERNATE FUNCTION .... 3 = ANALOG SPEED: 0 = 2MHz (Low Speed) .... 1 = 25MHz (Med. Speed) .... 2 = 50MHz (Fast Speed) .... 3 = 100MHz/80MHz (High Speed)(100MHz(30pf) - 80MHz(15pf)) PUPD: 0 = No Pull-Up / No Pull-Down .... 1 = Pull-Up Enabled .... 2 = Pull-Down Enabled .... 3 = Reserved */ myGPIO->MODER |= (MODE << (PIN * 2));//OUTPUT myGPIO->OSPEEDR |= (SPEED << (PIN * 2));//50MHz myGPIO->PUPDR |= (PUPD << (PIN * 2)); //Set it for NO PUPD }
  12. atomsoft

    Hey!

    Hi everyone, the names Jason aka AtomSoft. I have a blog: http://atomsoft.wordpress.com I also have a online shop: http://atomsofttech.com I originally found this forum because someone linked to my site from here. While im not a professional at all i do know a ton of stuff and hope to learn more. While here i plan to learn (ask questions) and help out (answer questions). I know a but about everything from... ARM, PIC, (very little AVR) For ARM i only use C... for PIC i use ASM & C, AVR (C only) So just dropping in to say hello and introduce myself
  13. Thanks for linking to my site and the comment This forum looks cool so far. Im going to be here more often i suspect
×
×
  • Create New...