PDA

View Full Version : comments on a/d converter so far



cammo
- 22nd March 2005, 18:24
This is what i got so far for the project which im doing using
a pic16f870 microcontroller.
It is a heartbeat monitor which increments the counter everytime
an analogue signal from the heart is registered.This is the
first part where im only reading each heartbeat and incr. the
counter. Am i on the right track or way off? also imstill confused
about how to go about making an interrupt that after a minute the
value in the counter will be displayed,any tips will be helpful.
__________________________________________________ ____________

bsf status, rp0
clrw
movwf ADCON1 ;Setting up analogue inputs
movlw 01h ;Choosing RA0
movwf TRISA ;as analogue input
bcf status, rp0
;
;
heartb btfsc porta,0 ;Testing for pulse if no pulse skip next instr
goto moni ;Goto monitor the no of heartbeats
goto heartb
;
moni incf count,1 ;Counting the no of heartbeats
call dly ;calling a 1 millisec delay
goto heart

;One millisecond delay so that the pulse has gone low again.

Melanie
- 25th March 2005, 15:52
The problem we have here is that you're using Assembler and this is a PICBasic forum... if you had PICBasic, you could simply use the COUNT command and count the number of pulses in a set perod...

NavMicroSystems
- 25th March 2005, 18:41
cammo,

in addition to what Melanie has already said:

If you really think this is something to be posted on a PicBasic forum
then it should go to the Off Topic section.

You have a total of 4 posts on this forum.
Your posts are in 3 different threads
and in two different categories

and they are all about the same thing.

Do you really think this is necessary ?