Need some ARM tutorials

Hey,

I just got my hands on a [STM32F103RB dev kit with a 2.8in LCD using the Ili9320 controller. I am having a horrible time tracking down any documentation on how to actually initialize hardware properly and a description of all the peripherals. [HERE is a link to an example program running the LCD. It is wonderfully laid out but I dont understand things like this:

void MYRCC_DeInit(void)
{										  					   
	RCC->APB1RSTR = 0x00000000;		 
	RCC->APB2RSTR = 0x00000000; 	  
  	RCC->AHBENR = 0x00000014;  	  
  	RCC->APB2ENR = 0x00000000; 			   
  	RCC->APB1ENR = 0x00000000;   
	RCC->CR |= 0x00000001;    	 															 
	RCC->CFGR &= 0xF8FF0000;   // SW[1:0],HPRE[3:0],PPRE1[2:0],PPRE2[2:0],ADCPRE[1:0],MCO[2:0]					 
	RCC->CR &= 0xFEF6FFFF;     // HSEON,CSSON,PLLON
	RCC->CR &= 0xFFFBFFFF;     // HSEBYP	   	  
	RCC->CFGR &= 0xFF80FFFF;   // PLLSRC, PLLXTPRE, PLLMUL[3:0] and USBPRE 
	RCC->CIR = 0x00000000;    
					  
#ifdef  VECT_TAB_RAM
//	NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else  /* VECT_TAB_FLASH  */
//	NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#endif
}

What does RCC do and where can I find out what things like AHBENR even mean? I found the headers files that define the structures and map them to internal registers but It seems each compiler has its own headers and RCC is special to whatever compiler this program was made with. I suspect Kiel.

I will be using Rowley CrossWorks and haven’t found a single tutorial for that yet.

Can anybody give me a hand or point me to some website explaining how to interface with the ARM’s peripherals?](http://www.micro4you.com/files/STM32/2.8%20TFT%20LCD%20V3%20demo.rar)](http://www.micro4you.com/store/Mini-STM32-STM32F103-TFT-LCD-Board-V3/prod_133.html)

Details will be in the chip documentation.

Start with something simpler like turning an LED on and off.

Yeah, I also have found it quite an effort to get my head around the arm-based microcontrollers. I suppose a big part of the reason is that the core, chip, development tools, and (usually) dev board all come from different places.

Be sure to get both the data sheet and the reference manual for the STM32F103RB from the st web site. Another document st has stored is the [Insider’s Guide from Hitex. IMO this is the least painful overview of the guts of an STM32, even if it is a bit dated these days, and does not have enough detail to be called a tutorial. (You can get the same document from [Hitex; you need to register first.)](http://www.hitex.co.uk/index.php?id=download-insiders-guides0)](http://www.st.com/mcdfiles/1221142709.pdf)

hsutherl:
Yeah, I also have found it quite an effort to get my head around the arm-based microcontrollers. I suppose a big part of the reason is that the core, chip, development tools, and (usually) dev board all come from different places.

That should not be a problem as long as you confirm that either:

a) the dev board vendor provides support for the development tool that you are using

or

b) the dev tool vendor provides technical support for their tool on the board that you are intending to use.

hsutherl:
Be sure to get both the data sheet and the reference manual for the STM32F103RB from the st web site. Another document st has stored is the [Insider’s Guide from Hitex. IMO this is the least painful overview of the guts of an STM32, even if it is a bit dated these days, and does not have enough detail to be called a tutorial. [/quote]

Awesome link thanks! That gives a much easier to understand explanation of things. The STM32 manual is 1072 pages long and its a bit hard to swallow at first, this is no 8bit uC with easy to understand registers. Bit banding for example without an explanation is utterly useless, once you know how it works it makes good since… kinda…

I was looking through code and their where a lot of TIM2_ENABLE(TRUE) functions and the like and they had all the registers being set across different functions and I was confused. Each compiler has its own way of doing things due to whoever writing the header files but I’m getting to get the mnemonics down now so its easier to understand things.

Its sure gonna be nice to be able to use c++ though, my word is it hard to keep ‘member’ variables out of the reach of the end user in c.

Now for the longshot, anyone seen example projects or tutorials with the STM32 using Rowley CrossWorks?](http://www.st.com/mcdfiles/1221142709.pdf)