Example #1
0
//debug code
int main(void){
	PLL_Init(Bus80MHz);	// bus clock at 50 MHz
  Output_Init();
	SYSCTL_RCGCGPIO_R |= 0x20;       // activate port F
	//ADC0_InitTimer0ATriggerSeq3(2, F30HZ); // ADC channel 0, 1000 Hz sampling
	ADC0_InitTimer0ATriggerSeq3PD3(F30HZ);
  //ADC0_InitSWTriggerSeq3_Ch9();
	while((SYSCTL_PRGPIO_R&0x0020) == 0){};// ready?
  GPIO_PORTF_DIR_R |= 0x02;        // make PF1 output (PF1 built-in LEDs)
  GPIO_PORTF_AFSEL_R &= ~0x02;     // disable alt funct on PF1
  GPIO_PORTF_DEN_R |= 0x02;        // enable digital I/O on PF1
                                   // configure PF1 as GPIO
  GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFFF0FF)+0x00000000;
  GPIO_PORTF_AMSEL_R = 0;          // disable analog functionality on PF
  EnableInterrupts();

	plotInit();
		
	while(1){
		GPIO_PORTF_DATA_R ^= 0x02;           // toggle LED
		//ADCvalue = ADC0_InSeq3();
		temperature = adcToTemp(ADCvalue + offset);
		plotPoint();
		ST7735_SetCursor(1,2);
		ST7735_sDecOut2(temperature);
		ST7735_SetCursor(2,1);
		ST7735_OutUDec(ADCvalue + offset);
	}
}
Example #2
0
int main(void){ 
  PLL_Init(Bus80MHz); 	// 80 MHz
  UART_Init();      		// initialize UART device
	//initialize ADC, hardware timer trigger, 100Hz sampling
	ADC0_InitTimer0ATriggerSeq3PD3(f100HZ);  
	TxFifo_Init();	// initialize FIFO
	ST7735_InitR(INITR_REDTAB); // initialize LCD
	ST7735_InitTemperatureGraph();	// initialize graph area
	
	EnableInterrupts();

	while(1){
		TxFifo_Get(&adcValue);	// get most recent ADC value from FIFO
		ST7735_UpdateTemperatureGraph(numSamples, adcValue); // plot new point and display ADC and temperature values
    numSamples++;                       // counts the number of samples
	}
}