PDA

View Full Version : pic18f2620 freezing



jetpr
- 27th January 2009, 21:07
Hello is some one have this problems and fix it help me..

my pic work but when i on plug a hall sensor and my pic freezing ..

:rolleyes:

Dave
- 27th January 2009, 23:37
jetpr, I use 18F2620's for just about all of my projects and products at work. I have never had such a problem.. Code please?

Dave Purola,
N8NTA

jetpr
- 28th January 2009, 13:46
RPM=0
RPMSamp=0
RPMSamp1=0
RPMSamp2=0
'** RPM **
'60 ms Sample time yields direct RPM readout in 1000's
'Comments start with real RPM of 143,578 and RPMNumSamps=3
Count tachPin, 60 * RPMNumSamps, RPMSamp 'RPMSamp = 430
RPMSamp = RPMSamp * 10 'RPMSamp = 4300
' pause 20
' Count tachPin, 60 * RPMNumSamps, RPMSamp2 'RPMSamp = 430
' RPMSamp2 = RPMSamp2 * 10 'RPMSamp = 4300
' RPMSamp=(RPMSamp1+RPMSamp2)/2
RPM = RPMSamp / (RPMNumSamps * 10) 'RPM = 143
IF NOT RPMNoDecimal Then 'Calculate the tenths if RPMNoDecimal = 0
RPML = RPMSamp // (RPMNumSamps * 10) 'RPML = 10
RPML = RPML / RPMNumSamps 'RPML = 3
EndIF

mackrackit
- 28th January 2009, 14:06
Is that the whole code?

mister_e
- 28th January 2009, 16:50
Well, I guess not ;) But poor PCB layout, schematic, PSU filtering could indeed produce few unwanted issue, that's for sure.

Latch-up caused by a high voltage spike on MCLR (entering programming mode) could be one source. The whole schematic, board layout and whole code would definitely help