I need save datas in a SD Card with a Blue pill.
-
- Posts: 12
- Joined: Tue Nov 17, 2020 11:10 pm
I need save datas in a SD Card with a Blue pill.
Hello, i'm neubie about STM32 but i really like Arduino and others Boards. I need save the value temperature of ten sensors in a SD Card in TXT format, but i don't know who do it. Anyone can help me? I'm using STM35F103C (Blue Pill) and i'm programing with ST-link V2. (i'm sorry for my horrible english)
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: I need save datas in a SD Card with a Blue pill.
The general idea of Analog pins on the Blue Pill:
https://www.electronicshub.org/how-to-u ... 2f103c8t6/
https://www.ametherm.com/thermistor/ntc ... t-equation
I would strongly suggest you start slow with just 1 analog port. Send the results to the serial port. After you have that correct, build out the other 9 analog circuits, one by one.
When you get all 10 values on the console, then implement the SD Card recorder.
Note, you can "fine tune" each thermistor using software, or you can pay more money for precision 1% thermistors and resistors. There are other sensors too that can be used for temperature measurements:
https://www.google.com/search?&q=arduin ... ure+sensor
https://randomnerdtutorials.com/9-ardui ... -projects/
Here is an Adafruit thermistor tutorial.
Good luck,
Ray
https://www.electronicshub.org/how-to-u ... 2f103c8t6/
So, 10 thermistors, 10 series resistors, an SD Card, software. Something like this but with the output of the NTC thermistors going thru the algorithm:... ADC in STM32 Blue Pill board is configured for 10 Channels i.e. you can use the 10 Analog Input pins to measure 10 different analog voltages.
https://www.ametherm.com/thermistor/ntc ... t-equation
I would strongly suggest you start slow with just 1 analog port. Send the results to the serial port. After you have that correct, build out the other 9 analog circuits, one by one.
When you get all 10 values on the console, then implement the SD Card recorder.
Note, you can "fine tune" each thermistor using software, or you can pay more money for precision 1% thermistors and resistors. There are other sensors too that can be used for temperature measurements:
https://www.google.com/search?&q=arduin ... ure+sensor
https://randomnerdtutorials.com/9-ardui ... -projects/
Here is an Adafruit thermistor tutorial.
Good luck,
Ray
-
- Posts: 12
- Joined: Tue Nov 17, 2020 11:10 pm
Re: I need save datas in a SD Card with a Blue pill.
i'm really thankful. You really help me. Last doumbt, the BluePill board has a two SPIO channels, SPIO1 and SPIO2, Who i can select the SPIO2 for use with SD Card, it's just select CS pin when i start the SD card or i need declared the others SPIO pins, like Miso?
Re: I need save datas in a SD Card with a Blue pill.
There no SPIO. It's SPI. And there are 2 SPI interfaces.
Depending on library you can select which SPI it uses or it uses only SPI1.
SPI1 is on pins PA5-PA7, SPI2 is on pins PB13-PB15 (usually only MISO, MOSI and SCK pins are used).
For CS you can use any pin or NSS (PA4 for SPI1 or PB12 for SPI2).
For STM32F103 blue pill Arduino SD library is the easiest to use: https://www.arduino.cc/en/reference/SD.
It's using SPI1 only.
Depending on library you can select which SPI it uses or it uses only SPI1.
SPI1 is on pins PA5-PA7, SPI2 is on pins PB13-PB15 (usually only MISO, MOSI and SCK pins are used).
For CS you can use any pin or NSS (PA4 for SPI1 or PB12 for SPI2).
For STM32F103 blue pill Arduino SD library is the easiest to use: https://www.arduino.cc/en/reference/SD.
It's using SPI1 only.