GR-KAEDE board microcontroller has inbuilt temperature sensor.
How we can program it for sensing the temperature ?
I am not sure whether GR Kaede library has already support for Temperature sensor but if you go through user manual of RX64M documentation.renesas.com/.../r01uh0377ej0100_rx64m.pdf you can find a flow chart which explains about how you can access temperature sensor (page number 2707).
You can write direct to registers and read temperature sensor readings.
Note: This wont give ambient temperature. Instead it will give MCU's internal temperature.
Our KAEDE libraries compatible with Arduino. It allows to create application easily without knowledge of Renesas 32bit MCU.
No need to read the RX64M datasheet.
float temp_volt = 0;
temp_volt = analogRead(PIN_ANTMP);
temp_volt = temp_volt * 0.48828125;
Serial.print("Temp : ");
The above code may be helps you electron.
In reply to VASHI:
Electron is asking about internal temperature sensor that MCU has. The example you have given is to read from external analog pin.
Description Reads the value from the specified analog pin.
Syntax int analogRead(uint8_t analog_pin)
Parameters analog_pin: the number of the analog input pin to read from (A0-A7, or 22-27)
Returns int 0 to 1023; for 12-bit A/D conversion, 0 to 4095
The temp sensor is reading the body heat of the microcontroller. You can increase the temperature by heating the microcontroller with a solder iron.
But don't heat the microcontroller. It may damage your board.
Is PIN_ANTMP is for Internal Temperature sensor of microcontroller ?
In reply to electron:
Internal temperature doesn't require pin to measure, because its inbuild. It has ADC connected directly inside MCU of which you can read data by the method i have given above. By using pin you can only connect external sensor, there is no logic that can read it from external PIN. The only way is to read from specific Temp Sensor ADC data register as specified in RX64M user manual.
Ok. There isn't a library for getting temperature.
But I try to implement that near the future.
But we have predefined macro :
#define PIN_ANTMP 29
What is the use of this macro ?
Not only A0-A7 as analog input pin.
In our KAEDE, We have around 14 analog input pins.
** Analog pins, header CN15. */
#define PIN_AN000 14
#define PIN_AN001 15
#define PIN_AN002 16
#define PIN_AN003 17
#define PIN_AN004 18
#define PIN_AN005 19
/** Analog pins, header CN13. */
#define PIN_AN006 20
#define PIN_AN007 21
/** Analog pins, header CN12. */
#define PIN_AN008 22
#define PIN_AN009 23
#define PIN_AN010 24
#define PIN_AN011 25
#define PIN_AN012 26
#define PIN_AN013 27