Hi,
I copied the code in post #16 into microcode studio version 4.0.0.0, selecting 16F88 in the drop down menu and clicked on compile and it compiled using PBP 2.60c with MPSAM 5.06 with no errors
The only change I had to make was change LOOP to MAIN for the main program loop
Code:
'************************************************* ***************
'* Name : AnalogDEBUG *
'* Author : [Davidpower] *
'* [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 05.12.2017 *
'* Version : 1.0 *
'* Notes : 16F88 no LCD *
'* : Portb.7 analog IN 0-5V *
'************************************************* ***************
Include "modedefs.bas"
Define OSC 4
Define ADC_BITS 4 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uSec
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 2
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_Mode 0
DEFINE DEBUG_PACING 1000
CMCON = 7 ' Disable analog comparator
ANSEL = %01000000 ' set AN6 (RB7) as analog, others to digital
ADCON1.7 = 1 '
GLCDBM VAR WORD
PAUSE 1000 ' lcd settle time
DEBUG 10,13
main:
ADCIN 6,GLCDBM ' Read channel 6 (RB7)
DEBUG "*.*",DEC5 GLCDBM,13,10
Goto main
Mugel if you could use the code tags to insert code it makes the post easier to read ( use [ code ] insert your code here [ / code ] - remove the spaces between square brackets and code)
Not sure if the code works as it should, but thought I would see if it compiled on an version 2.60 with an old copy of MPSAM...
Bookmarks