PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : مشکل با ADC میکرو stm32f103



paradox7
15-11-2014, 22:40
سلام
یه مشکل با ADC پیدا کردم ممنون میشم راهنمایی کنید.(خیلی حیاتی ،امیدوارم مثل سوالای دیگه ام بدون جواب نمونه :()
میخوام دما رو از طریق سنسور دمای lm35 روی السیدی نمایش بدم .(از برد مینی فروشگاه استفاده میکنم)خود سنسور رو با اسکوپ تست کردم تو دمای معمولی 200 میلی ولت نشون میداد و وقتی دستم رو روش میگیرم به 300 میلی ولت میرسه.
ولی وقتی من برنامه نویسی میکنم که مقدار ولتاژ سنسور توسط ADC با استفاده از فرمول زیر به میلی ولت تبدیل بشه و روی السیدی نمایش داده بشه عدد 2550 به بالا روی السیدی نشون داده میشه و هی تغییر میکنه وقتی هم دستم رو میگیرم روی سنسور تغییرات محسوسی نمیبینم و این یعنی پروژه دماسنجم کار نمیکنه .ایراد کار کجا میتونه باشه؟چطوری برطرفش کنم ؟

(وقتی پایه ADC رو به گراند وصل میکنم عدد صفر روی السیدی نشون داده میشه و وقتی به تغذیه وصل میکنم 3299)


;uint32_t T,a
;(a = ADC_GetConversionValue(ADC1
;T=(a*3300)/4096

bascom2
16-11-2014, 21:19
با سلام
شما در رابطه بالا 3300 را 3.3 قرار بده درست می شود

اما من یک مشکلی دارم و اون این هست که موقعی که چیزی به وردی adc این میکرو ها وصل نشود انها در وضعیت high اممپدانس هستند لذا مقدار max را نشون میدند چه طور میشه در هنگامی که به انها چیزی اعمال نمی شود انها را در وضعیت low قرار داد و مقدار صفر را خواند؟
با تشکر

paradox7
16-11-2014, 22:30
ببخشید ولی اینطوری که برحسب ولت میشه نه میلی ولت!!!

paradox7
19-11-2014, 11:49
کسی مشکل برنامه من رو متوجه نشد؟
پایان نامه من به خاطر این مشکلات کوچیک مونده .به یه دانشجوی کنکوری کمک کنید تا دفاع کنه بشینه برای کنکور بخونه دیگه :(
از چندتا استادام هم پرسیدم بلد نبودن.
پروژه مو بعد کنکور کامل اینجا قرار میدم .

hariri2
19-11-2014, 22:12
برنامه که درست کار کرده
احتمالا ورودی نویز داره یه فیلتر rc بزار

paradox7
19-11-2014, 22:40
نه درست کار نمیکنه 200 میلی ولت رو داره 2500 نشون میده !اگه ورودی بشه 300 میلی ولت تغییرات نسبت به 2500 اونقدر محسوس نیست که بفمیم دما تغییر کرده !(دست رو اگه روی سنسور بگیریم متوجه تغییرات دما نمیشیم اصلا )

mzarkoob
20-11-2014, 10:48
سلام
قدم اول اینه که یه برنامه داشته باشید که به ورودی آنالوگش یک پتانسیومتر بذارید از 0 تا 3.3 ولت نشون بده. وقتی کهر کنه اصل کار درسته
حالا میمونه ورودی شما که 200 یا 300 میلی ولته. خوب این در مقابل ولتاژ رفرنس 3.3 ولت خیلی کمه

hariri2
20-11-2014, 10:51
روی برد بستی بعد اسکوپ گذاشتی؟
گفتی عدد هی تغییر میکنه چقدر عوض میشه؟

پایه adc نباید pull up باشه رجیستر های pinmode

paradox7
26-11-2014, 20:54
سلام
قدم اول اینه که یه برنامه داشته باشید که به ورودی آنالوگش یک پتانسیومتر بذارید از 0 تا 3.3 ولت نشون بده. وقتی کهر کنه اصل کار درسته
حالا میمونه ورودی شما که 200 یا 300 میلی ولته. خوب این در مقابل ولتاژ رفرنس 3.3 ولت خیلی کمه

سلام
برنامه رو با پتانسیومتر تست کردم جواب میده .همزمان با اسکوپ ولتاژ رو میدیدم کاملا درست نشون میده.
ورودی در حالت عادی بدون اتصال به adc ،دویست میلی ولته ولی وقتی به adc متصل کردم شد 2500میلی ولت چرا ؟مگه adc خودش تقویت کننده داره ؟
فهمیدم ایراد از برنامه نیست .چطوری میتونم دقت خوندن رو بالا ببرم تا متوجه بالارفتن دما بشم ؟
یه سوال دیگه چطوری میشه جلو نویز رو گرفت که انفدر مقادیر adc تغییر نکنه ؟
پیشاپیش سپاسگزارم .

- - - Updated - - -


روی برد بستی بعد اسکوپ گذاشتی؟
گفتی عدد هی تغییر میکنه چقدر عوض میشه؟

پایه adc نباید pull up باشه رجیستر های pinmode

بله روی برد بستم بعد اسکوپ گذاشتم .
مثلا 2560و2572و2554 اینا سه عدد متوالی که روی السیدی نمایش داده میشه.

پیشاپیش سپاسگزارم

paradox7
17-12-2014, 20:42
من هنوز نتونستم جواب بگیرم :(کسی هست من را یاری کند؟
بافر هم قرار دادم بین lm35 و میکرو ولی باز هم فایده نداشت .
جالب اینجاست که با فتوسل امتحان کردم برای اون این حالت پیش نمیاد .
یعنی مشکل کجاست ؟خواهش میکنم هرچی به ذهنتون میرسه بگین :(

NoBoko
17-12-2014, 22:57
شما دستوراتی که در این کدتون هست رو با رفرنس خود CMSIS چک کنید، تا ایرادش رو راحت تر پیدا کنید:

You can see links before reply

مثلا ممکنه ایراد از اینجا باشه:

ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1, ADC_SampleTime_13Cycles5);


برای پیدا کردن درستش مثلا در رفرنس سرچ می کنید : "ADC_RegularChannelConfig" یا "ADC_SampleTime"

بعد یک سری مثال و کدهای سورس لایبرری واستون میاد، که داخل کدها می تونید متوجه بشید که درستش چیه و مفهوم کد چی هستش،
مثلا من که با stm32f4 کار میکنم تنظیمات این قسمتش توی رفرنس توضیح داده:




Configures for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. Parameters:

ADCx,:
where x can be 1, 2 or 3 to select the ADC peripheral.


ADC_Channel,:

the ADC channel to configure. This parameter can be one of the following values:


[*=left]ADC_Channel_0: ADC Channel0 selected
[*=left]ADC_Channel_1: ADC Channel1 selected
[*=left]ADC_Channel_2: ADC Channel2 selected
[*=left]ADC_Channel_3: ADC Channel3 selected
[*=left]ADC_Channel_4: ADC Channel4 selected
[*=left]ADC_Channel_5: ADC Channel5 selected
[*=left]ADC_Channel_6: ADC Channel6 selected
[*=left]ADC_Channel_7: ADC Channel7 selected
[*=left]ADC_Channel_8: ADC Channel8 selected
[*=left]ADC_Channel_9: ADC Channel9 selected
[*=left]ADC_Channel_10: ADC Channel10 selected
[*=left]ADC_Channel_11: ADC Channel11 selected
[*=left]ADC_Channel_12: ADC Channel12 selected
[*=left]ADC_Channel_13: ADC Channel13 selected
[*=left]ADC_Channel_14: ADC Channel14 selected
[*=left]ADC_Channel_15: ADC Channel15 selected
[*=left]ADC_Channel_16: ADC Channel16 selected
[*=left]ADC_Channel_17: ADC Channel17 selected
[*=left]ADC_Channel_18: ADC Channel18 selected




Rank,:
The rank in the regular group sequencer. This parameter must be between 1 to 16.


ADC_SampleTime,:

The sample time value to be set for the selected channel. This parameter can be one of the following values:


[*=left]ADC_SampleTime_3Cycles: Sample time equal to 3 cycles
[*=left]ADC_SampleTime_15Cycles: Sample time equal to 15 cycles
[*=left]ADC_SampleTime_28Cycles: Sample time equal to 28 cycles
[*=left]ADC_SampleTime_56Cycles: Sample time equal to 56 cycles
[*=left]ADC_SampleTime_84Cycles: Sample time equal to 84 cycles
[*=left]ADC_SampleTime_112Cycles: Sample time equal to 112 cycles
[*=left]ADC_SampleTime_144Cycles: Sample time equal to 144 cycles
[*=left]ADC_SampleTime_480Cycles: Sample time equal to 480 cycles







دیگه به قول اون ژاپنیه که می گفت: به طرف ماهیگیری یاد بده نه ماهی رو
این جا هم دوستان اکثرا ژاپنی فکر میکنن:0013:

paradox7
17-12-2014, 23:25
ممنون بابت پیشنهادتون .دوباره چک میکنم.
ولی گویا برنامه مشکل نداره adc تو سخت افزار مشکل ایجاد کرده همونطور که گفتم به جای سنسور پتانسومتر قرار دادم و با اسکوپ همزمان چک کردم کاملا جواب درست بود(ولتاژ روی اسکوپ با ولتاژی که رو السیدی دیدم یکی بودند) ولی نمیدونم چرا با سنسور دما مشکل داره !حتی با سنسور نور هم جواب درستی میگیرم !

NoBoko
18-12-2014, 01:04
خوب شما باید ببینید اصلا سنسور سالمه یا نه، شاید اصلا بریک داون شده رفته !

برای کم کردن نویز ADC و ولتاژ رفرنس باید این دستورالعمل رو بخونید:
You can see links before reply

یک بار هم با دستور ADC_TempSensorVrefintCmd(ENABLE); ولتاژ رفرنس رو به صورت داخلی تعریف کنید که میشه 1.2 ولت.

paradox7
19-12-2014, 16:35
سنسور سالمه چون با اسکوپ که امتحان کردم ولتاژش با هر درجه افزایش یک میلی ولت بالامیره !در دمای معمولی حدود 20 میلی ولته وقتی دستم رو روش قرار میدم بالای 30 میلی ولت میره !

الان مشکل اینجاست که با اتصال adc ولتاژ بالا میره یعنی میکرو روی سنسور دما تأثیر میذاره!این مشکل برای سنسور نور وجود نداره !میخوام یه کاری کنم که میکرو تأثیر نذاره!(فکر کردم با گذاشتن بافر میشه اینکار رو کرد ولی بافر هم نتیجه نداد)

ممنون بابت دستورالعمل !مطالعه میکنم نتیجه رو میگم.

NoBoko
19-12-2014, 17:45
همان طور که دوستان هم گفتن بهتره پولینگ پایه adc روی Nopull باشه یعنی این خط باید به تنظیمات gpio اضافه بشه:

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
در ضمن باید حواستان باشه که منبع تغذیه سنسور و برد باید یکی باشه،و زمین ها یکی.
و این سنسور دما با ولتاژ 5 ولت کار میکنه، اگه به صورت ناخواسته خروجیش 5 ولت بشه بعید نیست به پایه adc آسیب بزنه، ولتاژ رفرنس هم 3.3 هست (یا 1.2 ولت).البته این stm32 فکر کنم تمهیداتی گذاشته که آسیب نبینه!

paradox7
30-12-2014, 23:05
خداروشکر مشکل خوندن همزمان از چند کانال adc حل شد .:o
فقط همین مشکل lm35 مونده.
به احتمال خیلی زیاد مشکل همین پولینگ هستش .ولی دستورش رو نتونستم پیدا کنم.
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

این دستور رو که مینویسم ارر میگیره
..\Source\main.c(126): error: #136: struct "<unnamed>" has no field "GPIO_PuPd"
..\Source\main.c(126): error: #20: identifier "GPIO_PuPd_NOPULL" is undefined




میشه راهنمایی کنین؟

Doloop
31-12-2014, 01:23
سلام

مطمئنی دستور رو درست نوشتی؟!!!

برو تو لایبرری gpio ببین دستور همینجوریه؟!!

paradox7
31-12-2014, 10:41
سلام این دستور برای سری stm32f4 هستش .
من تو لایبرری gpio دستوری برای پولینگ پیدا نکردم !فقط توی تعیین مد دوتا حالت pull up,pull down داریم !
میشه راهنمایی کنین؟

Doloop
31-12-2014, 12:56
سلام برنامه رو قرار بدید بهتر میشه نظر داد :0013:
منظور من هم همین فقط توی تعیین مد دوتا حالت pull up,pull down داریم هست، دستورش رو مطمئنید درست نوشتید!!!

paradox7
31-12-2014, 15:06
main برنامه به این صورت هست :


#include "stm32f10x.h"
#include "lcd4bit.h"
#include "stdio.h"

void Delay(__IO uint32_t num)
{
__IO uint32_t index = 0;

/* default system clock is 72MHz */
for(index = (72000 * num); index != 0; index--)
{
}
}

__IO uint32_t ADCConvertedValue;

void RCC_Configuration(void);
void GPIO_Configuration(void);

//*********************************MAIN************* ***********************//

int main(void)
{

ADC_InitTypeDef ADC_InitStructure;
unsigned int d=0,i=0,dd=0,temp;
int j;
char s[16];
uint32_t T,a;

RCC_Configuration();
GPIO_Configuration();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
ADC_InitStructure.ADC_ScanConvMode = DISABLE;
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_InitStructure.ADC_NbrOfChannel = 1;
ADC_Init(ADC1, &ADC_InitStructure);

ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_13Cycles5);

ADC_Cmd(ADC1, ENABLE);
ADC_ResetCalibration(ADC1);
while(ADC_GetResetCalibrationStatus(ADC1));
ADC_StartCalibration(ADC1);
while(ADC_GetCalibrationStatus(ADC1));
ADC_SoftwareStartConvCmd(ADC1, ENABLE);

while (1)
{
a = ADC_GetConversionValue(ADC1);
T=(a*3300)/4096;
lcd_init();
{
sprintf(s,"input:%d mv",T);
set_cursor(1,1);
lcd_putsf(s);
Delay(50);
i++;
d=T+d;
if(i==5)
{
dd=d/5;
i=0;
d=0;
}

temp=dd/100;
sprintf(s,"temp:%d 0c",temp);
set_cursor(2,1);
lcd_putsf(s);
Delay(50);
set_cursor(2,1);
for(j=0;j<16;j++)
lcd_putchar(' ');
}
}
}
//************************************************** ********//

void RCC_Configuration(void)
{
ErrorStatus HSEStartUpStatus;
RCC_DeInit();
RCC_HSEConfig(RCC_HSE_ON);
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enabl e);
FLASH_SetLatency(FLASH_Latency_2);
RCC_HCLKConfig(RCC_SYSCLK_Div1);
RCC_PCLK2Config(RCC_HCLK_Div1);
RCC_PCLK1Config(RCC_HCLK_Div2);
RCC_ADCCLKConfig(RCC_PCLK2_Div4);
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
RCC_PLLCmd(ENABLE);
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
while(RCC_GetSYSCLKSource() != 0x08);
}
RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_GPIOA , ENABLE);
}

//************************************************** ******************

void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; // A0->analog input for ADC ch1-->LM35
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
}

مد هایی که برای gpio میتونیم درنظر بگیریم به این صورت هست :

:GPIO_Mode_AIN تعيين وضعيت به حالت ورودي آنالوگ(حالت معمولي(
:GPIO_Mode_IN_FLOATING تعيين وضعيت به حالت ورودي شناور(حالت معمولي(
:GPIO_Mode_IPD تعيين وضعيت به حالت ورودي با مقاومت Pull-down (حالت معمولي)
:GPIO_Mode_IPU تعيين وضعيت به حالت ورودي با مقاومت pull-up (حالت معمولي)
:GPIO_Mode_Out_OD تعيين وضعيت به حالت خروجي با درين باز(حالت معمولي)
:GPIO_Mode_Out_PP تعيين وضعيت به حالت خروجي با حالت push-pull (حالت معمولي)
:GPIO_Mode_AF_OD تعيين وضعيت به حالت خروجي با درين باز(حالت خاص)
:GPIO_Mode_AF_PP تعيين وضعيت به حالت خروجي با حالت push-pull (حالت خاص)

لایبرری gpio:



/**
************************************************** ****************************
* @file stm32f10x_gpio.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @brief This file provides all the GPIO firmware functions.
************************************************** ****************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
************************************************** ****************************
*/

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"

/** @addtogroup STM32F10x_StdPeriph_Driver
* @{
*/

/** @defgroup GPIO
* @brief GPIO driver modules
* @{
*/

/** @defgroup GPIO_Private_TypesDefinitions
* @{
*/

/**
* @}
*/

/** @defgroup GPIO_Private_Defines
* @{
*/

/* ------------ RCC registers bit address in the alias region ----------------*/
#define AFIO_OFFSET (AFIO_BASE - PERIPH_BASE)

/* --- EVENTCR Register -----*/

/* Alias word address of EVOE bit */
#define EVCR_OFFSET (AFIO_OFFSET + 0x00)
#define EVOE_BitNumber ((uint8_t)0x07)
#define EVCR_EVOE_BB (PERIPH_BB_BASE + (EVCR_OFFSET * 32) + (EVOE_BitNumber * 4))


/* --- MAPR Register ---*/
/* Alias word address of MII_RMII_SEL bit */
#define MAPR_OFFSET (AFIO_OFFSET + 0x04)
#define MII_RMII_SEL_BitNumber ((u8)0x17)
#define MAPR_MII_RMII_SEL_BB (PERIPH_BB_BASE + (MAPR_OFFSET * 32) + (MII_RMII_SEL_BitNumber * 4))


#define EVCR_PORTPINCONFIG_MASK ((uint16_t)0xFF80)
#define LSB_MASK ((uint16_t)0xFFFF)
#define DBGAFR_POSITION_MASK ((uint32_t)0x000F0000)
#define DBGAFR_SWJCFG_MASK ((uint32_t)0xF0FFFFFF)
#define DBGAFR_LOCATION_MASK ((uint32_t)0x00200000)
#define DBGAFR_NUMBITS_MASK ((uint32_t)0x00100000)
/**
* @}
*/

/** @defgroup GPIO_Private_Macros
* @{
*/

/**
* @}
*/

/** @defgroup GPIO_Private_Variables
* @{
*/

/**
* @}
*/

/** @defgroup GPIO_Private_FunctionPrototypes
* @{
*/

/**
* @}
*/

/** @defgroup GPIO_Private_Functions
* @{
*/

/**
* @brief Deinitializes the GPIOx peripheral registers to their default reset values.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @retval None
*/
void GPIO_DeInit(GPIO_TypeDef* GPIOx)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

if (GPIOx == GPIOA)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, DISABLE);
}
else if (GPIOx == GPIOB)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, DISABLE);
}
else if (GPIOx == GPIOC)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, DISABLE);
}
else if (GPIOx == GPIOD)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, DISABLE);
}
else if (GPIOx == GPIOE)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, DISABLE);
}
else if (GPIOx == GPIOF)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOF, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOF, DISABLE);
}
else
{
if (GPIOx == GPIOG)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOG, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOG, DISABLE);
}
}
}

/**
* @brief Deinitializes the Alternate Functions (remap, event control
* and EXTI configuration) registers to their default reset values.
* @param None
* @retval None
*/
void GPIO_AFIODeInit(void)
{
RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, ENABLE);
RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, DISABLE);
}

/**
* @brief Initializes the GPIOx peripheral according to the specified
* parameters in the GPIO_InitStruct.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that
* contains the configuration information for the specified GPIO peripheral.
* @retval None
*/
void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
{
uint32_t currentmode = 0x00, currentpin = 0x00, pinpos = 0x00, pos = 0x00;
uint32_t tmpreg = 0x00, pinmask = 0x00;
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
assert_param(IS_GPIO_PIN(GPIO_InitStruct->GPIO_Pin));

/*---------------------------- GPIO Mode Configuration -----------------------*/
currentmode = ((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x0F);
if ((((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x10)) != 0x00)
{
/* Check the parameters */
assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed));
/* Output mode */
currentmode |= (uint32_t)GPIO_InitStruct->GPIO_Speed;
}
/*---------------------------- GPIO CRL Configuration ------------------------*/
/* Configure the eight low port pins */
if (((uint32_t)GPIO_InitStruct->GPIO_Pin & ((uint32_t)0x00FF)) != 0x00)
{
tmpreg = GPIOx->CRL;
for (pinpos = 0x00; pinpos < 0x08; pinpos++)
{
pos = ((uint32_t)0x01) << pinpos;
/* Get the port pins position */
currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
if (currentpin == pos)
{
pos = pinpos << 2;
/* Clear the corresponding low control register bits */
pinmask = ((uint32_t)0x0F) << pos;
tmpreg &= ~pinmask;
/* Write the mode configuration in the corresponding bits */
tmpreg |= (currentmode << pos);
/* Reset the corresponding ODR bit */
if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD)
{
GPIOx->BRR = (((uint32_t)0x01) << pinpos);
}
else
{
/* Set the corresponding ODR bit */
if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU)
{
GPIOx->BSRR = (((uint32_t)0x01) << pinpos);
}
}
}
}
GPIOx->CRL = tmpreg;
}
/*---------------------------- GPIO CRH Configuration ------------------------*/
/* Configure the eight high port pins */
if (GPIO_InitStruct->GPIO_Pin > 0x00FF)
{
tmpreg = GPIOx->CRH;
for (pinpos = 0x00; pinpos < 0x08; pinpos++)
{
pos = (((uint32_t)0x01) << (pinpos + 0x08));
/* Get the port pins position */
currentpin = ((GPIO_InitStruct->GPIO_Pin) & pos);
if (currentpin == pos)
{
pos = pinpos << 2;
/* Clear the corresponding high control register bits */
pinmask = ((uint32_t)0x0F) << pos;
tmpreg &= ~pinmask;
/* Write the mode configuration in the corresponding bits */
tmpreg |= (currentmode << pos);
/* Reset the corresponding ODR bit */
if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD)
{
GPIOx->BRR = (((uint32_t)0x01) << (pinpos + 0x08));
}
/* Set the corresponding ODR bit */
if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU)
{
GPIOx->BSRR = (((uint32_t)0x01) << (pinpos + 0x08));
}
}
}
GPIOx->CRH = tmpreg;
}
}

/**
* @brief Fills each GPIO_InitStruct member with its default value.
* @param GPIO_InitStruct : pointer to a GPIO_InitTypeDef structure which will
* be initialized.
* @retval None
*/
void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
{
/* Reset GPIO init structure parameters values */
GPIO_InitStruct->GPIO_Pin = GPIO_Pin_All;
GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING;
}

/**
* @brief Reads the specified input port pin.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bit to read.
* This parameter can be GPIO_Pin_x where x can be (0..15).
* @retval The input port pin value.
*/
uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
uint8_t bitstatus = 0x00;

/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GET_GPIO_PIN(GPIO_Pin));

if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET)
{
bitstatus = (uint8_t)Bit_SET;
}
else
{
bitstatus = (uint8_t)Bit_RESET;
}
return bitstatus;
}

/**
* @brief Reads the specified GPIO input data port.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @retval GPIO input data port value.
*/
uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

return ((uint16_t)GPIOx->IDR);
}

/**
* @brief Reads the specified output data port bit.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bit to read.
* This parameter can be GPIO_Pin_x where x can be (0..15).
* @retval The output port pin value.
*/
uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
uint8_t bitstatus = 0x00;
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GET_GPIO_PIN(GPIO_Pin));

if ((GPIOx->ODR & GPIO_Pin) != (uint32_t)Bit_RESET)
{
bitstatus = (uint8_t)Bit_SET;
}
else
{
bitstatus = (uint8_t)Bit_RESET;
}
return bitstatus;
}

/**
* @brief Reads the specified GPIO output data port.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @retval GPIO output data port value.
*/
uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

return ((uint16_t)GPIOx->ODR);
}

/**
* @brief Sets the selected data port bits.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bits to be written.
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
* @retval None
*/
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));

GPIOx->BSRR = GPIO_Pin;
}

/**
* @brief Clears the selected data port bits.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bits to be written.
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
* @retval None
*/
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));

GPIOx->BRR = GPIO_Pin;
}

/**
* @brief Sets or clears the selected data port bit.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bit to be written.
* This parameter can be one of GPIO_Pin_x where x can be (0..15).
* @param BitVal: specifies the value to be written to the selected bit.
* This parameter can be one of the BitAction enum values:
* @arg Bit_RESET: to clear the port pin
* @arg Bit_SET: to set the port pin
* @retval None
*/
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
assert_param(IS_GPIO_BIT_ACTION(BitVal));

if (BitVal != Bit_RESET)
{
GPIOx->BSRR = GPIO_Pin;
}
else
{
GPIOx->BRR = GPIO_Pin;
}
}

/**
* @brief Writes data to the specified GPIO data port.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param PortVal: specifies the value to be written to the port output data register.
* @retval None
*/
void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

GPIOx->ODR = PortVal;
}

/**
* @brief Locks GPIO Pins configuration registers.
* @param GPIOx: where x can be (A..G) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bit to be written.
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
* @retval None
*/
void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
uint32_t tmp = 0x00010000;

/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));

tmp |= GPIO_Pin;
/* Set LCKK bit */
GPIOx->LCKR = tmp;
/* Reset LCKK bit */
GPIOx->LCKR = GPIO_Pin;
/* Set LCKK bit */
GPIOx->LCKR = tmp;
/* Read LCKK bit*/
tmp = GPIOx->LCKR;
/* Read LCKK bit*/
tmp = GPIOx->LCKR;
}

/**
* @brief Selects the GPIO pin used as Event output.
* @param GPIO_PortSource: selects the GPIO port to be used as source
* for Event output.
* This parameter can be GPIO_PortSourceGPIOx where x can be (A..E).
* @param GPIO_PinSource: specifies the pin for the Event output.
* This parameter can be GPIO_PinSourcex where x can be (0..15).
* @retval None
*/
void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
{
uint32_t tmpreg = 0x00;
/* Check the parameters */
assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_Por tSource));
assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));

tmpreg = AFIO->EVCR;
/* Clear the PORT[6:4] and PIN[3:0] bits */
tmpreg &= EVCR_PORTPINCONFIG_MASK;
tmpreg |= (uint32_t)GPIO_PortSource << 0x04;
tmpreg |= GPIO_PinSource;
AFIO->EVCR = tmpreg;
}

/**
* @brief Enables or disables the Event Output.
* @param NewState: new state of the Event output.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void GPIO_EventOutputCmd(FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_FUNCTIONAL_STATE(NewState));

*(__IO uint32_t *) EVCR_EVOE_BB = (uint32_t)NewState;
}

/**
* @brief Changes the mapping of the specified pin.
* @param GPIO_Remap: selects the pin to remap.
* This parameter can be one of the following values:
* @arg GPIO_Remap_SPI1 : SPI1 Alternate Function mapping
* @arg GPIO_Remap_I2C1 : I2C1 Alternate Function mapping
* @arg GPIO_Remap_USART1 : USART1 Alternate Function mapping
* @arg GPIO_Remap_USART2 : USART2 Alternate Function mapping
* @arg GPIO_PartialRemap_USART3 : USART3 Partial Alternate Function mapping
* @arg GPIO_FullRemap_USART3 : USART3 Full Alternate Function mapping
* @arg GPIO_PartialRemap_TIM1 : TIM1 Partial Alternate Function mapping
* @arg GPIO_FullRemap_TIM1 : TIM1 Full Alternate Function mapping
* @arg GPIO_PartialRemap1_TIM2 : TIM2 Partial1 Alternate Function mapping
* @arg GPIO_PartialRemap2_TIM2 : TIM2 Partial2 Alternate Function mapping
* @arg GPIO_FullRemap_TIM2 : TIM2 Full Alternate Function mapping
* @arg GPIO_PartialRemap_TIM3 : TIM3 Partial Alternate Function mapping
* @arg GPIO_FullRemap_TIM3 : TIM3 Full Alternate Function mapping
* @arg GPIO_Remap_TIM4 : TIM4 Alternate Function mapping
* @arg GPIO_Remap1_CAN1 : CAN1 Alternate Function mapping
* @arg GPIO_Remap2_CAN1 : CAN1 Alternate Function mapping
* @arg GPIO_Remap_PD01 : PD01 Alternate Function mapping
* @arg GPIO_Remap_TIM5CH4_LSI : LSI connected to TIM5 Channel4 input capture for calibration
* @arg GPIO_Remap_ADC1_ETRGINJ : ADC1 External Trigger Injected Conversion remapping
* @arg GPIO_Remap_ADC1_ETRGREG : ADC1 External Trigger Regular Conversion remapping
* @arg GPIO_Remap_ADC2_ETRGINJ : ADC2 External Trigger Injected Conversion remapping
* @arg GPIO_Remap_ADC2_ETRGREG : ADC2 External Trigger Regular Conversion remapping
* @arg GPIO_Remap_ETH : Ethernet remapping (only for Connectivity line devices)
* @arg GPIO_Remap_CAN2 : CAN2 remapping (only for Connectivity line devices)
* @arg GPIO_Remap_SWJ_NoJTRST : Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST
* @arg GPIO_Remap_SWJ_JTAGDisable : JTAG-DP Disabled and SW-DP Enabled
* @arg GPIO_Remap_SWJ_Disable : Full SWJ Disabled (JTAG-DP + SW-DP)
* @arg GPIO_Remap_SPI3 : SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices)
* When the SPI3/I2S3 is remapped using this function, the SWJ is configured
* to Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST.
* @arg GPIO_Remap_TIM2ITR1_PTP_SOF : Ethernet PTP output or USB OTG SOF (Start of Frame) connected
* to TIM2 Internal Trigger 1 for calibration (only for Connectivity line devices)
* If the GPIO_Remap_TIM2ITR1_PTP_SOF is enabled the TIM2 ITR1 is connected to
* Ethernet PTP output. When Reset TIM2 ITR1 is connected to USB OTG SOF output.
* @arg GPIO_Remap_PTP_PPS : Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices)
* @arg GPIO_Remap_TIM15 : TIM15 Alternate Function mapping (only for Value line devices)
* @arg GPIO_Remap_TIM16 : TIM16 Alternate Function mapping (only for Value line devices)
* @arg GPIO_Remap_TIM17 : TIM17 Alternate Function mapping (only for Value line devices)
* @arg GPIO_Remap_CEC : CEC Alternate Function mapping (only for Value line devices)
* @arg GPIO_Remap_TIM1_DMA : TIM1 DMA requests mapping (only for Value line devices)
* @arg GPIO_Remap_TIM9 : TIM9 Alternate Function mapping (only for XL-density devices)
* @arg GPIO_Remap_TIM10 : TIM10 Alternate Function mapping (only for XL-density devices)
* @arg GPIO_Remap_TIM11 : TIM11 Alternate Function mapping (only for XL-density devices)
* @arg GPIO_Remap_TIM13 : TIM13 Alternate Function mapping (only for High density Value line and XL-density devices)
* @arg GPIO_Remap_TIM14 : TIM14 Alternate Function mapping (only for High density Value line and XL-density devices)
* @arg GPIO_Remap_FSMC_NADV : FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices)
* @arg GPIO_Remap_TIM67_DAC_DMA : TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices)
* @arg GPIO_Remap_TIM12 : TIM12 Alternate Function mapping (only for High density Value line devices)
* @arg GPIO_Remap_MISC : Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping,
* only for High density Value line devices)
* @param NewState: new state of the port pin remapping.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void GPIO_PinRemapConfig(uint32_t GPIO_Remap, FunctionalState NewState)
{
uint32_t tmp = 0x00, tmp1 = 0x00, tmpreg = 0x00, tmpmask = 0x00;

/* Check the parameters */
assert_param(IS_GPIO_REMAP(GPIO_Remap));
assert_param(IS_FUNCTIONAL_STATE(NewState));

if((GPIO_Remap & 0x80000000) == 0x80000000)
{
tmpreg = AFIO->MAPR2;
}
else
{
tmpreg = AFIO->MAPR;
}

tmpmask = (GPIO_Remap & DBGAFR_POSITION_MASK) >> 0x10;
tmp = GPIO_Remap & LSB_MASK;

if ((GPIO_Remap & (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK)) == (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK))
{
tmpreg &= DBGAFR_SWJCFG_MASK;
AFIO->MAPR &= DBGAFR_SWJCFG_MASK;
}
else if ((GPIO_Remap & DBGAFR_NUMBITS_MASK) == DBGAFR_NUMBITS_MASK)
{
tmp1 = ((uint32_t)0x03) << tmpmask;
tmpreg &= ~tmp1;
tmpreg |= ~DBGAFR_SWJCFG_MASK;
}
else
{
tmpreg &= ~(tmp << ((GPIO_Remap >> 0x15)*0x10));
tmpreg |= ~DBGAFR_SWJCFG_MASK;
}

if (NewState != DISABLE)
{
tmpreg |= (tmp << ((GPIO_Remap >> 0x15)*0x10));
}

if((GPIO_Remap & 0x80000000) == 0x80000000)
{
AFIO->MAPR2 = tmpreg;
}
else
{
AFIO->MAPR = tmpreg;
}
}

/**
* @brief Selects the GPIO pin used as EXTI Line.
* @param GPIO_PortSource: selects the GPIO port to be used as source for EXTI lines.
* This parameter can be GPIO_PortSourceGPIOx where x can be (A..G).
* @param GPIO_PinSource: specifies the EXTI line to be configured.
* This parameter can be GPIO_PinSourcex where x can be (0..15).
* @retval None
*/
void GPIO_EXTILineConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
{
uint32_t tmp = 0x00;
/* Check the parameters */
assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSou rce));
assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));

tmp = ((uint32_t)0x0F) << (0x04 * (GPIO_PinSource & (uint8_t)0x03));
AFIO->EXTICR[GPIO_PinSource >> 0x02] &= ~tmp;
AFIO->EXTICR[GPIO_PinSource >> 0x02] |= (((uint32_t)GPIO_PortSource) << (0x04 * (GPIO_PinSource & (uint8_t)0x03)));
}

/**
* @brief Selects the Ethernet media interface.
* @note This function applies only to STM32 Connectivity line devices.
* @param GPIO_ETH_MediaInterface: specifies the Media Interface mode.
* This parameter can be one of the following values:
* @arg GPIO_ETH_MediaInterface_MII: MII mode
* @arg GPIO_ETH_MediaInterface_RMII: RMII mode
* @retval None
*/
void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface)
{
assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_ MediaInterface));

/* Configure MII_RMII selection bit */
*(__IO uint32_t *) MAPR_MII_RMII_SEL_BB = GPIO_ETH_MediaInterface;
}

/**
* @}
*/

/**
* @}
*/

/**
* @}
*/

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

Doloop
31-12-2014, 21:42
سلام

فهمیدم مشکلتون کجاست ...!

من لایبرری GPIO رو دیدم البته منظور بنده توی هدرفایل GPIO بود که تو پست قبلی شما اشتباهی کپی کردید ... دیگه دستور NOPull نداریم یعنی وقتی شما پین رو تو مد AIN قرار بدید خودش بدون پول آپ و پول دان لحاظ میکنه
پس پیکربندی GPIO تون درسته :0013:

توی این قسمت هم تابع پیکر بندی مد GPIO هست





typedef enum
{
GPIO_Speed_10MHz = 1,
GPIO_Speed_2MHz,
GPIO_Speed_50MHz
}GPIOSpeed_TypeDef;
#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_Speed_10MHz) || ((SPEED) == GPIO_Speed_2MHz) || \
((SPEED) == GPIO_Speed_50MHz))

/**
* @brief Configuration Mode enumeration
*/

typedef enum
{ GPIO_Mode_AIN = 0x0,
GPIO_Mode_IN_FLOATING = 0x04,
GPIO_Mode_IPD = 0x28,
GPIO_Mode_IPU = 0x48,
GPIO_Mode_Out_OD = 0x14,
GPIO_Mode_Out_PP = 0x10,
GPIO_Mode_AF_OD = 0x1C,
GPIO_Mode_AF_PP = 0x18
}GPIOMode_TypeDef;

#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_Mode_AIN) || ((MODE) == GPIO_Mode_IN_FLOATING) || \
((MODE) == GPIO_Mode_IPD) || ((MODE) == GPIO_Mode_IPU) || \
((MODE) == GPIO_Mode_Out_OD) || ((MODE) == GPIO_Mode_Out_PP) || \
((MODE) == GPIO_Mode_AF_OD) || ((MODE) == GPIO_Mode_AF_PP))

/**
* @brief GPIO Init structure definition
*/

typedef struct
{
uint16_t GPIO_Pin; /*!< Specifies the GPIO pins to be configured.
This parameter can be any value of @ref GPIO_pins_define */

GPIOSpeed_TypeDef GPIO_Speed; /*!< Specifies the speed for the selected pins.
This parameter can be a value of @ref GPIOSpeed_TypeDef */

GPIOMode_TypeDef GPIO_Mode; /*!< Specifies the operating mode for the selected pins.
This parameter can be a value of @ref GPIOMode_TypeDef */
}GPIO_InitTypeDef;





موفق باشید .. :wink:

paradox7
31-12-2014, 21:53
خب پس چرا lm35 اینطوری میشه ؟:(

یکبار دیگه مشکلم رو مطرح میکنم با اجازتون:
من دارم از سنسور دمای lm 35 استفاده میکنم که با افزایش هر درجه دما ده میلی ولت ولتاژش افزایش پیدا میکنه .
در حالت عادی وقتی تغذیه این سنسور رو وصل میکنم و ولتاژش رو با اسکوپ اندازه میگیرم کاملا درسته و 200 میلی ولت نشون میده وقتی دستم رو روش قرار میدم ولتاژش بالای 300 میلی ولت هست.
اما وقتی پایه adc رو وصل میکنم ولتاژ افزایش ناگهانی داره میشه 2000 میلی ولت و وقتی دستم رو روش قرار میدم تغییر محسوسی نداره.
چیکار کنم که درست بشه ؟:( چه راهی به ذهنتون میرسه؟
(توضیح اینکه برنامه adc رو با پتانسومتر امتحان کردم کاملا درست عمل میکنه)

ehsanbagheri
31-12-2014, 23:44
سلام
پایه خروجی سنسور رو هم با یه مقاومت حدود 4.7 کیلو زمین کنید
به ازای هر 1 درجه سانتیگراد 10میلی ولت باید افزایش ولتاژ داشته باشیم و تو دمای
اتاق باید حدود 200-300mv رو نشون بده
شاید واقعا سنسور آسیب دیده
با چنتا lm35 دیگه هم تست کن

paradox7
01-01-2015, 15:31
عذر خواهی میکنم من اشتباه کردم حرف شما درسته تو دمای معمولی 200 میلی ولت رو نشون میده .(چون تقسیم بر 10 باید بکنیم تا دما رو نشون بده اشتباه عددی شد. واقعا هم اینطور هست با اسکوپ که اندازه گرفتم 200 میلی ولت رو نشون میداد.)
پایه خروجی رو امتحان میکنم اگه جواب نداد دوباره میخرم .
ممنون بابت جوابتون.