Are you using any HSER DEFINE's ?
If so, comment them out.
MCSP sets the baud rate for the USART while debugging
<br>
Are you using any HSER DEFINE's ?
If so, comment them out.
MCSP sets the baud rate for the USART while debugging
<br>
DT
PULSE VAR PORTC.2
RL1 VAR PORTC.1
RL2 VAR PORTC.0
HEATIN VAR PORTA.1
SENSIN VAR PORTA.0
ADCON1 = 0011 'Declare A ports 0 & 1 as Analog to dig converters
ADCON1.7 = 1 'Analog to Digital variables declared right justified
TRISA = 255
DEFINE ADC_BITS 10 '10 bit conversion used
DEFINE ADC_SAMPLEUS 5 'set sample time
SENSVAL VAR Byte
DEFINE LOADER_USED 1
DISABLE DEBUG
loop_delay CON 500 ' adjust to tweak timing
ms_count VAR WORD
loop:
FOR ms_count = 0 TO 999 ' 0 to 999mS
IF ms_count < 14 THEN ' PULSE low 0 to 13 mS
low PULSE
ELSE ' PULSE and RL1 high at 14
high PULSE
high RL1
high RL2
ENDIF
IF MS_count > 8 THEN ' RL1 low at 9 mS
high RL2
ENDIF
IF ms_count > 995 THEN ' RL2 low at 995 mS, high at 0
low RL1
ENDIF
IF ms_count = 997 THEN ' Read PORTA.0 ADC VALUE put in mem loc 0
ADCIN PORTA.0, SENSVAL
ENDIF
IF ms_count < 500 THEN
High 0
ENDIF
IF ms_count > 499 THEN
low 0
ENDIF
IF ms_count < 500 THEN
low 1
ENDIF
IF ms_count > 499 THEN
high 1
ENDIF
PAUSEUS loop_delay ' fill in time for 1mS loop
NEXT ms_count
goto loop
END
Are you using a MAX232 between the USART and the PC.
Or, are you trying to use the melabs U2 to debug. (won't work)
Also, 99% of your program is disabled. Remove the DISABLE DEBUG.
<br>
DT
Yes Indeed, look the Help file... under the Hardware requirement. You'll discover something interesting
tutorial
http://www.rentron.com/PicBasic/MCS_X3.htm
schematic
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
You're welcome, good luck!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
And i think it's not the whole thing as well... some variable declaration are missing... AND...
unless there's a copy/paste error here, it may screw few things... No i didn't open TFM to know how much ADCON=11 is different of ADCON1=%0011Code:ADCON1 = 0011 'Declare A ports 0 & 1 as Analog to dig converters
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks