PulseSensor_Amped_Arduino icon indicating copy to clipboard operation
PulseSensor_Amped_Arduino copied to clipboard

using pulse sensor with ATtiny85 chip

Open diontan524 opened this issue 8 years ago • 13 comments

Hi there, I am planning to use the Pulse sensor on attiny85 chip. But looks like the code uploaded online have to be modified due to the fact that attiny85 does not have timer2 and serial communication. With added serialsoftware, I am able to serialprint words to the serial monitor with the Attiny85 chip, so im quite sure my code there has no problem. But for the timer2 to be modified as timer1, I am not sure the codes that I found online is correct or not. I tried to serial print the BPM but not luck. Can anyone help Please ?

diontan524 avatar Feb 19 '17 16:02 diontan524

Hi diontan524,

That looks great! I will give your code mod a test run on the ATtiny85 that I have, and add notes to our master branch (and credit you) when I get it working. Do you have your version posted on a repo somewhere?

joelSensor avatar Feb 21 '17 16:02 joelSensor

Nope i have not post this anywhere else. Thank you guys and hope to hear from u soon.

On Feb 22, 2017 12:52 AM, "Joel Murphy" [email protected] wrote:

Hi diontan524,

That looks great! I will give your code mod a test run on the ATtiny85 that I have, and add notes to our master branch (and credit you) when I get it working. Do you have your version posted on a repo somewhere?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/issues/41#issuecomment-281404306, or mute the thread https://github.com/notifications/unsubscribe-auth/AX1YfkkTCpbKs34-attEWi4EeZh-Hn2Fks5rexZogaJpZM4MFgpO .

diontan524 avatar Feb 22 '17 03:02 diontan524

anyone has any solution yet ?

diontan524 avatar Mar 01 '17 08:03 diontan524

Hi,

I have an ATtiny, but it is on a Digitspark, and in order to use it on my mac I need an external USB hub thing. Please give me some time to get it all together.

In the meantime, you can use the example that is at the bottom of the Timer Interrupt Notes tab. That shows how to set up a software timer to sample the pulse sensor data.

biomurph avatar Mar 01 '17 15:03 biomurph

I think it can use arduino to program it. That's the way I do it, by setting the arduino as ISP

diontan524 avatar Mar 01 '17 15:03 diontan524

Yes, I think that would work. My only ATtiny is attached to this digispark USB board. It already has the bootloader on it, etc.

biomurph avatar Mar 01 '17 15:03 biomurph

I see... Is it doable? I found many websites already unfortunately non of them solve this :'(

On Mar 1, 2017 11:54 PM, "Joel Murphy" [email protected] wrote:

Yes, I think that would work. My only ATtiny is attached to this digispark USB board. It already has the bootloader on it, etc.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/issues/41#issuecomment-283379952, or mute the thread https://github.com/notifications/unsubscribe-auth/AX1YfrE9VrxmjaeLMM4ivAWqngKfarduks5rhZSzgaJpZM4MFgpO .

diontan524 avatar Mar 01 '17 15:03 diontan524

Is it possible for you to use the software timer? I do know of someone who is using it. Have not been in touch with them in a while...

biomurph avatar Mar 01 '17 16:03 biomurph

Is it a library ? I heard the previous pulse sensor code is run by using timer 1 before it was changed to timer 2. Is it true ?

On Mar 2, 2017 12:14 AM, "Joel Murphy" [email protected] wrote:

Is it possible for you to use the software timer? I do know of someone who is using it. Have not been in touch with them in a while...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/issues/41#issuecomment-283386320, or mute the thread https://github.com/notifications/unsubscribe-auth/AX1YflKBRY2Y7Kcqkq774A-gqdeOcezSks5rhZlhgaJpZM4MFgpO .

diontan524 avatar Mar 01 '17 16:03 diontan524

Please check the Timer Interrupt Notes tab in this repo. At the end, it describes how to modify the code to use a software timer. It is not a library.

biomurph avatar Mar 01 '17 16:03 biomurph

I have updated the Timer Interrupt Notes page here https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/tree/master/PulseSensorAmped_Arduino_1.5.0 There are Interrupt setup notes for ATtiny 85 running at 8MHz and also at 16MHz. They reference the Adafruit GEMMA and TRINKET. They are tested and they work.

What speed master clock are you using?

I have an original Digispark, Kickstarter Edition board. It runs at 16.5MHz, which makes the timer interrupt kind of messy.

joelSensor avatar Mar 03 '17 18:03 joelSensor

ATtiny by default is 1Mhz, but I set and run it at 8Mhz

On Mar 4, 2017 2:35 AM, "Joel Murphy" [email protected] wrote:

I have updated the Timer Interrupt Notes page here https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/ tree/master/PulseSensorAmped_Arduino_1.5.0 There are Interrupt setup notes for ATtiny 85 running at 8MHz and also at 16MHz. They reference the Adafruit GEMMA and TRINKET. They are tested and they work.

What speed master clock are you using?

I have an original Digispark, Kickstarter Edition board. It runs at 16.5MHz, which makes the timer interrupt kind of messy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/issues/41#issuecomment-284033851, or mute the thread https://github.com/notifications/unsubscribe-auth/AX1YfsI-OhP5cEQH8TenHlWwkocfK8Sbks5riF1ngaJpZM4MFgpO .

diontan524 avatar Mar 03 '17 18:03 diontan524