/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Sensor footprint

Username:     
Password:     
             

Forum

# 1   2008-01-09 10:38:07 Sensor footprint

Benoit
Administrator
Registered: 2007-07-09
Posts: 30

Sensor footprint

On the bottom layer of the STM32Primer, I had quickly a 8  pin sensor footprint. I expect to make a short development with the primer but I have not enough time. So, if somebody have times and ideas it can take a look on this datasheet : http://www.freescale.com/files/sensors/ … A6115A.pdf
Enjoy.

Benoit

Offline

 

# 2   2008-01-09 14:05:33 Sensor footprint

quagmire
New member
Registered: 2007-10-24
Posts: 2

Re: Sensor footprint

If I read the data sheet correctly, the part needs a 5V supply to work correctly.  Did you plan on getting this via  USB power.  If, so it will only work when hooked up to a PC.  Or, did I miss a switched 5V source somewhere.

Offline

 

# 3   2008-01-10 08:26:20 Sensor footprint

Benoit
Administrator
Registered: 2007-07-09
Posts: 30

Re: Sensor footprint

Somebody tells me that this component should work also at 3V, it is necessary to validate this information by a test.
Regards,
Benoit

Offline

 

# 4   2008-01-13 00:58:46 Sensor footprint

mtuxpe
New member
Registered: 2007-10-18
Posts: 5

Re: Sensor footprint

Hi,
I can't find this sensor on schematics.

Offline

 

# 5   2008-01-13 10:07:17 Sensor footprint

Benoit
Administrator
Registered: 2007-07-09
Posts: 30

Re: Sensor footprint

This sensor does not exist on the schematic, only available on the footprint. I will recheck the possibility to use it at 3.3V, let me test it.

Regards,

Benoit

Offline

 

# 6   2008-01-14 01:41:16 Sensor footprint

mtuxpe
New member
Registered: 2007-10-18
Posts: 5

Re: Sensor footprint

Benoit,
This is my test application.

Code:

/************************* (C) COPYRIGHT 2007 RAISONANCE **********************
* File Name          :  Application.c
* Author             :
* Date First Issued  :
* Description        :  Circle_App CircleOS application template.
* Revision           :
*******************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "circle_api.h"

/* Private defines -----------------------------------------------------------*/

#define NEEDEDVERSION "V 1.7" // Put here the minimal CircleOS version needed by your application
/* Private define ------------------------------------------------------------*/
#define ADC1_DR_Address  ((u32)0x4001244C)
/* Private variables ---------------------------------------------------------*/
ADC_InitTypeDef ADC_InitStructure;
DMA_InitTypeDef DMA_InitStructure;
char adcStrValue[20];
u32 ADC_ConvertedValue;
float press;
/* Private functions ---------------------------------------------------------*/
enum MENU_code MsgVersion(void);

/* Public variables ----------------------------------------------------------*/

const char Application_Name[8+1] = {"Hello"};  // max 8 characters for application name

/*******************************************************************************
* Function Name  : Application_Ini
* Description    : Initialization function of Circle_App. This function will
*                  be called only once by CircleOS.
* Input          : None
* Return         : MENU_CONTINUE_COMMAND
*******************************************************************************/
enum MENU_code Application_Ini ( void )
   {
   if(strcmp(UTIL_GetVersion(), NEEDEDVERSION) < 0)
      {
      return MsgVersion();
      }
      
   GPIO_InitTypeDef GPIO_InitStructure;

    /* Enable ADC1 and GPIOA clock */
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_GPIOA, ENABLE);

  /* Configure PA.1 (ADC Channel1) as analog input -------------------------*/
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
   
  /* Configure PA.2 (ADC Channel2) as analog input -------------------------*/
//  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
//  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
//  GPIO_Init(GPIOA, &GPIO_InitStructure); 
      
      // TODO: Write your application initialization function here.

      
      
   return MENU_CONTINUE_COMMAND;
   }

/*******************************************************************************
* Function Name  : Application_Handler
* Description    : Management of the Circle_App.
*
* Input          : None
* Return         : MENU_CONTINUE
*******************************************************************************/
enum MENU_code Application_Handler ( void )
   {
const char msg[] ="ADC test";

   
   DRAW_DisplayString(5,8,msg,sizeof(msg));
   LED_Set ( LED_GREEN,LED_ON);
//   DRAW_Line ( 0,0,0,0,0);
//   DRAW_Line ( 1,1,2,1,RGB_ORANGE);
   // TODO: Write your application handling here.
   //       This routine will get called repeatedly by CircleOS, until we
   //       return MENU_LEAVE
   

  /* DMA channel1 configuration ----------------------------------------------*/
  DMA_DeInit(DMA_Channel1); 
  DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_DR_Address;
  DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADC_ConvertedValue;
  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
  DMA_InitStructure.DMA_BufferSize = 1;
  DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
  DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
  DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
  DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
  DMA_InitStructure.DMA_Priority = DMA_Priority_Low;
  DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
  DMA_Init(DMA_Channel1, &DMA_InitStructure);
  
  /* Enable DMA channel1 */
  DMA_Cmd(DMA_Channel1, ENABLE);
    /* ADC1 configuration ------------------------------------------------------*/
   ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
   ADC_InitStructure.ADC_ScanConvMode = DISABLE;
   ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
   ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
   ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
   ADC_InitStructure.ADC_NbrOfChannel = 1;
   ADC_Init(ADC1, &ADC_InitStructure);
   
   /* ADC1 regular channel1 configuration */ 
//   ADC_RegularChannelConfig(ADC1, ADC_Channel_2, 1, ADC_SampleTime_55Cycles5);
   ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1, ADC_SampleTime_55Cycles5);
   /* Enable ADC1 DMA */
   ADC_DMACmd(ADC1, ENABLE);

   /* Enable ADC1 */
   ADC_Cmd(ADC1, ENABLE);
   
   /* Start ADC1 Software Conversion */ 
   ADC_SoftwareStartConvCmd(ADC1, ENABLE);

  /* Test on Channel 1 DMA_FLAG_TC flag */
  while(!DMA_GetFlagStatus(DMA_FLAG_TC1));
  /* Clear Channel 1 DMA_FLAG_TC flag */
  DMA_ClearFlag(DMA_FLAG_TC1);
//  while ( ADC_GetFlagStatus(ADC1,ADC_FLAG_EOC) == RESET );
//   ADC_ConvertedValue = ADC_GetConversionValue(ADC1);

   ADC_ConvertedValue &= 0xfff;
   ADC_ConvertedValue = (ADC_ConvertedValue*3300)/0x1000;
   press = (313500+(float)ADC_ConvertedValue)/29700;
   u16 upress = press;
 //  UTIL_uint2str(&adcStrValue,ADC_ConvertedValue,8,1);
  
    UTIL_uint2str(&adcStrValue,upress,8,1);
   DRAW_DisplayString(15,24,adcStrValue,sizeof(adcStrValue));
   ADC_ConvertedValue = 0;
    // If button is pushed exit 
   if (  BUTTON_GetState() == BUTTON_PUSHED ) 
      {
      BUTTON_WaitForRelease();   
      BUTTON_SetMode  ( BUTTON_ONOFF_FORMAIN );
      LED_Set ( LED_GREEN,LED_OFF);
      LED_Set ( LED_RED,LED_OFF);
      LCD_SetBackLightOn();
      LCD_SetRotateScreen(1);
      MENU_ClearCurrentCommand();
      DRAW_SetDefaultColor ();
      DRAW_Clear();
      POINTER_SetMode ( POINTER_ON );
      return MENU_LEAVE;
      }

   return MENU_CONTINUE;   // Returning MENU_LEAVE will quit to CircleOS
   }

/*******************************************************************************
* Function Name  : MsgVersion
* Description    : Display the current CircleOS version and the version needed
*                  exit to main menu after 4 secondes
*
* Input          : None
* Return         : MENU_CONTINUE
*******************************************************************************/
enum MENU_code MsgVersion(void)
   {
   int hh,mm,ss,ss2;
   
   DRAW_DisplayString(5,60,"CircleOS",17);
   DRAW_DisplayString(80,60,UTIL_GetVersion(),3);
   DRAW_DisplayString(5,34,NEEDEDVERSION,3);
   DRAW_DisplayString(40,34," required",12);
   
   RTC_GetTime(&hh,&mm,&ss);
   ss = ss + 4;                  // 4 secondes 
   ss = ss%60;
   
   do
      {
      RTC_GetTime(&hh,&mm,&ss2);
      }while (ss2 != ss);           // do while < 4 secondes
   
   return MENU_REFRESH;
   }

Offline

 

# 7   2008-01-25 18:17:05 Sensor footprint

lzyuan
New member
Registered: 2008-01-22
Posts: 2

Re: Sensor footprint

where can i find the schematic of the primer?

Offline

 

# 8   2008-01-25 21:32:53 Sensor footprint

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Sensor footprint

Offline

 

# 9   2008-02-16 05:56:05 Sensor footprint

przemek
New member
Registered: 2008-02-16
Posts: 1

Re: Sensor footprint

Check out the second page of the schematics; I believe that VCC3 (U2 pin 3) is 5V; U2 is ST5R33
step-up voltage regulator.

Offline

 

# 10   2008-02-17 20:49:41 Sensor footprint

Benoit
Administrator
Registered: 2007-07-09
Posts: 30

Re: Sensor footprint

In fact, the ST5R33 is a step up regulator that generate in all the case a 3.3V. You can find the datasheet here http://www.stm32circle.com/projects/fil … T5R00.pdf.
The goal of this regulator is to provide a fixe voltage value althought the battery voltage decrease.

Benoit

Offline

 

# 11   2008-09-02 23:37:53 Sensor footprint

jacques
Member
Registered: 2008-09-02
Posts: 10

Re: Sensor footprint

Benoit :

Somebody tells me that this component should work also at 3V, it is necessary to validate this information by a test.
Benoit

Yes it is working, output values are different that expected from datasheet, but after recalibration it is ok.
We use it in a 3.3V design

Offline

 

Board footer