S I M P L E code don't want to work right??

Status
Not open for further replies.

MrDEB

Well-Known Member
I am in the learning stage of Swordfish and trying to learn how to use the USART and CONST
Using Jubebug connected to daughter board via ICSP port.
Have all the dip switches OFF
powering ON then opening the USART tool in Pickit2
The LED on port B.0 flashes at 1 second intervals
LED on port B1 stays ON
NO display on the pc screen
Code:
device = 18F1320
clock = 8 // 8MHz clock
config OSC = INTIO2, WDT = OFF, LVP = OFF
 
 
include "internalOscillator.bas" 
include "USART.bas"
include "Convert.bas"
include  "Utils.bas"
include "string.bas"
dim LED as PORTB.0
dim Index as byte 
 const ConstArray(2) as byte = (100, 200)
// main program...
OSCCON = $72
//ADCON1 = $7f
SetAllDigital 

// display value to terminal program, include

// CR and LF

SetBaudrate(br9600)


for Index = 0 to bound(ConstArray)

   USART.Write(DecToStr(ConstArray(Index)), 13, 10)   
        high(LED)
        repeat
        toggle (LED)
        delayms (1000)
        until false
next
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…