julpage / stm32-max30102

Heart rate
66 stars 18 forks source link

The module max30102 does not turn on #2

Closed mohammadamin137 closed 2 years ago

mohammadamin137 commented 2 years ago

Hello politeness and respect... I was Looking for the module and setting up that . then found your project and compile it in EAWRM but _When I open the project file for the first give error with this title(( max30102.map contains an incorrect path )) and I click OK it goes but I dont know what is that. _When I compile it run with 0 error and display shows up bpm and spo2 but the max30102 wont lights up . But I tried to fix it and in the max30102.c file line 36 comment it (( data = 0x40;)) with // and after display shows the heart line and 00 bpm 00 spo2 but still max30102 wont works. please help me...

julpage commented 2 years ago

1. maybe ired data is too low and determining the finger is not on the sensor. See line 221 in max30102.c.

2. In some case. The IR and Red data returned by some 30102 modules is inverted. I don't know why. And this may cause R bigger than 1 and shows 0 result on screen.

try: In void max30102_getFIFO(SAMPLE *data, uint8_t sampleCount) Change data[i].red ---> data[i].iRed data[i].iRed ---> data[i].red

mohammadamin137 commented 2 years ago

HELLO again ... I was a little confused... I tried to do exactly the methods ,but I did not get an answer... I think I have to do it myself and read the data sheet... But if the datasheet alone is not enough, I will be happy to use your information, dear master, and thank you for sharing this project. I learn a lot from it:) ;

mohammadamin137 commented 2 years ago

Hello Please Please restart this project with the module max 30102. because ((I try try and try)) I tried to find a way to start it and I did not succeed and only the screen turns on and the module is off and does not work. If you have an ID in Telegram, I will be happy because it is easier to communicate and I am more online in Instagram and Telegram and of course I think your access is limited.

mohammadamin137 commented 2 years ago

The calculation algorithm in your program as well as how the numbers are displayed on the screen is excellent. and for the function of max30102 int() in ur project I have make some changes like:

uint8_t max30102_write_reg(uint8_t uch_addr,uint8_t uch_data) { HAL_I2C_GetState(&hi2c2);

HAL_I2C_Mem_Write(&hi2c2,MAX30102_ADDR_WRITE,uch_addr,1,&uch_data,1,HAL_MAX_DELAY); return 1; } uint8_t max30102_read_reg(uint8_t uch_addr, uint8_t *puch_data) {

HAL_I2C_GetState(&hi2c2);

HAL_I2C_Mem_Read(&hi2c2, MAX30102_ADDR_READ, uch_addr, 1, puch_data, 1, HAL_MAX_DELAY);

return 1; } And because I thinks that problem of I2c with this process I rewrite max30102_inint() ; void max30102_init() { max30102_write_reg(RES_MODE_CONFIGURATION,0x40); max30102_write_reg(RES_INTERRUPT_ENABLE_1,0xC0); max30102_write_reg(RES_INTERRUPT_ENABLE_2,0x00); max30102_write_reg(RES_FIFO_WRITE_POINTER,0x00); max30102_write_reg(RES_OVERFLOW_COUNTER,0x00); max30102_write_reg(RES_FIFO_READ_POINTER,0x00); max30102_write_reg(RES_FIFO_CONFIGURATION,0x0F); max30102_write_reg(RES_MODE_CONFIGURATION,0x03); max30102_write_reg(RES_SPO2_CONFIGURATION,0x27); max30102_write_reg(RES_LED_PLUSE_AMPLITUDE_1,0x24); max30102_write_reg(RES_LED_PLUSE_AMPLITUDE_2,0x24);
max30102_write_reg(RES_PROXIMITY_MODE_LED_PLUSE_AMPLITUDE,0x7F); }

mohammadamin137 commented 2 years ago

........

julpage commented 2 years ago

i haven't read all your init code. but the first line have problem.

max30102_write_reg(RES_MODE_CONFIGURATION,0x40);

see datasheet, bit 6 is restart, you need to wait until this bit reset before you do other stuff

mohammadamin137 commented 2 years ago

Add a delay (1000) for that line because I saw in another library ... I do not think there was a problem with this function, of course I tried to replace another library, but the method of calculating the program is different. Now even guess. I can not guess where the problem is...

mohammadamin137 commented 2 years ago

ahh question, what color is your module ?green or brown mine is brown Model. and is it works fine for you? can I know if it works for you properly or not?

julpage commented 2 years ago

4983F52E-EC6F-444A-9CE1-6470FE3F8707 20B59F31-1C8D-440C-9BCB-8A95E5ACC698 i bought this last year, can work

mohammadamin137 commented 2 years ago

ahhh so whats wrong with this!?:D really It is confusing Im using ftdi for programing. and store a hex file from compiler and program micro with cube prog ???

mohammadamin137 commented 2 years ago

do you make any changes in your program now? or run it without changing? if not i think shuold delete the corrent project and download it again ???

mohammadamin137 commented 2 years ago

IMG_20220502_170537.jpg IMG_20220502_170314.jpg

the oled shows like this and max is off

julpage commented 2 years ago

emmmmm…… Try to use the logic analyzer to observe the whole initialization process

mohammadamin137 commented 2 years ago

but when i make some changes in inint func: IMG_20220502_171717.jpgIMG_20220502_172934.jpg

the screen shows like that but max not working, its just for me and, just works for you i dont know why🤯🤔

mohammadamin137 commented 2 years ago

emmmmm…… Try to use the logic analyzer to observe the whole initialization process

sorry but how use logic i dont know about it?

mohammadamin137 commented 2 years ago

emmmmm…… Try to use the logic analyzer to observe the whole initialization process

sorry but how use logic i dont know about it?

oh i will search about it

mohammadamin137 commented 2 years ago

haha I thought that its a code in stm32 because I have never used it... I do not have access to it, unfortunately

mohammadamin137 commented 2 years ago

I think this issue remains in a state of ambiguity. ;D

mohammadamin137 commented 2 years ago

soooo✋🏻😅😂

I take back my word and the issue has been solved IMG_20220504_231747.jpg

mohammadamin137 commented 2 years ago

I do not know exactly why and why but my micro I2C2 pins PB11, PB10 do not work🤔🙏🏻 Thanks anyway.

multius commented 2 years ago

我也遇到了类似楼主的问题,最后发现我的问题其实是我将max30102模块的vin脚误接到了核心板的v5脚,更换回v3脚之后max30102就能正常工作了。

I also encountered a problem similar to you, and finally found that my problem was actually that I mistakenly connected the vin pin of the max30102 module to the v5 pin of the core board, and the max30102 could work normally after replacing the v3 pin.

mohammadamin137 commented 2 years ago

我也遇到了类似楼主的问题,最后发现我的问题其实是我将max30102模块的vin脚误接到了核心板的v5脚,更换回v3脚之后max30102就能正常工作了。

I also encountered a problem similar to you, and finally found that my problem was actually that I mistakenly connected the vin pin of the max30102 module to the v5 pin of the core board, and the max30102 could work normally after replacing the v3 pin.

Yes, it can have different causes, but I do not have any 5v pins on the microcontroller, all if those are 3.3 😁 for now im trying to do a header board stm32f103c8 with altium and One-layer boards pcb. and I will do that for pulse oximeter max30102 ،And that will be my next challenge...

ahmar4472 commented 2 years ago

soooo✋🏻😅😂

I take back my word and the issue has been solved IMG_20220504_231747.jpg Hello hope you are doing great I am encountering the same problem my sensor is also to turning on I am also using ftdi module to burn the hex file on the blue pill but it does not turn on to chick the sensor I have chick it with Arduino Uno it is working fine but with stm it is not working kindly tell me the proper way that how you have turned on the sensor

Thank You