i am using the hp02s sensor in a circuit for barometr.i have read of the calibration
value d0=46170,t0=35393,p0=10127,s=340,c=298 .my value for t1 and d1 61423 61423.please help me.they are t1=d1?vcc=5v and i make with timer0 a frequency for mclk.and my frequency atmega 32 is 1MHz
i am using lcd for display. i think my freaquency mclk is mistek.am i corect?
The Timer_isr function takes too much time.
Much more than 12 cycles as you want to perform.
Therefore, MCLK is much slower than the required 32 kHz.
You should toggle PortB.5 (MCLK) hardwarly, not softwarly.
Hapilly PortB.5 is OC1A output od Timer1.
Or, you may try to run Atmega on highest frequency. For example 8MHz.
Then Timer_isr maybe will be take place (then they will have 125 cycles).
In general You had an error in the timer settings. If you wanted pulses every 12 cycles you should enter not 12, but 256-12 = 244.
But now it does not matter because you have to write 256-125 = 131, which is close to 125.
You must check in Program Simulation how high is the MCLK frequency.
Yes, d1 should change. t1 not necessarily.
But look, d1 ald t1 is 61423. It is 0xEFEF.
It's obvious look as a read error.
I still guess that you have too small MCLK frequency. Did you check it in the simulation?
I checked it myself. Timer_isr takes 123 cycles. Far too long in order to it could work.
It is necesary to convert it to the assembler.
I guess that You didn't do it independent, so ... here:
I'm sorry i hurt you very much.I made some changes that you said.my value changed .d0=46170,t0=35393,p0=10127,s=340,c=298,d1=t1=61423,p=10212
but I essentially Tsvrmyknm case I'm wrong ,I expected that when I change location of sensor(high or low) my value will change but perhaps I'm not going to use these sensors to control the room had a space robot, but maybe this is not the right
.I'm going deside for 1 sensor when robot change her hands I control it. do you know sensor for my work? again very thanks for your help