MrDEB
Well-Known Member
I have something outta place?? I checked my cheat sheet for correct layout of directives etc but??
note I have been attempting to get code written for an 18F 24K20 pic using Swordfish. Need to use internal oscalliator and PortA6 &7 as outputs
DEVICE = 18F24K20 ' Tell the compiler what chip we are using
CLOCK = 8 ' Tell the compiler what we will be setting the clock to (Mhz)
CONFIG MCLRE = OFF
CONFIG FOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7
OSCCON = %01100000 ' Internal oscillator running at 8mHz
CM1CON0 = 0 ' set ports to digital
CM2CON0 = 0 '
ANSEL = 0 '
ANSELH = 0 '
//INCLUDE "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
//INCLUDE "utils.bas"
TRISA = %00000000 ' PORTA outputs
TRISB = %00000000 ' PORTB outputs
TRISC = %00000000 ' PORTC outputs
DIM rows AS BYTE
DIM colums AS BYTE
DIM i AS BYTE
//SUB RightToLeft()
// DIM i AS BYTE
WHILE true
FOR i = 0 TO 7
PORTB.Bits(i) = 1
portC.1 = 1
DELAYMS(500)
PORTB.Bits(i) = 0
NEXT
WEND
note I have been attempting to get code written for an 18F 24K20 pic using Swordfish. Need to use internal oscalliator and PortA6 &7 as outputs
DEVICE = 18F24K20 ' Tell the compiler what chip we are using
CLOCK = 8 ' Tell the compiler what we will be setting the clock to (Mhz)
CONFIG MCLRE = OFF
CONFIG FOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7
OSCCON = %01100000 ' Internal oscillator running at 8mHz
CM1CON0 = 0 ' set ports to digital
CM2CON0 = 0 '
ANSEL = 0 '
ANSELH = 0 '
//INCLUDE "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
//INCLUDE "utils.bas"
TRISA = %00000000 ' PORTA outputs
TRISB = %00000000 ' PORTB outputs
TRISC = %00000000 ' PORTC outputs
DIM rows AS BYTE
DIM colums AS BYTE
DIM i AS BYTE
//SUB RightToLeft()
// DIM i AS BYTE
WHILE true
FOR i = 0 TO 7
PORTB.Bits(i) = 1
portC.1 = 1
DELAYMS(500)
PORTB.Bits(i) = 0
NEXT
WEND