PDA

View Full Version : MicroCode Studio Plus Problems



Mike2545
- 10th August 2009, 23:37
I have the MicroCode Studio Plus installed and am having trouble getting it to connect.

I am using the 18F1320

Here is a portion of my code:

include "BS2DEFS.BAS"

'OSCCON =$ff 'clock speed
OSCCON = $62
ADCON0 = 0 'diable A/D
ADCON1= 127 'all digital out
define OSC 4

' Set Debug pin port
DEFINE DEBUG_REG PORTB
define DEBUGIN_REG PORTB
' Set Debug pin bit
DEFINE DEBUG_BIT 4
DEFINE DEBUGIN_BIT 2
define DEBUG_PACING 2000
' Set Debug baud rate
DEFINE DEBUG_BAUD 2400

' Set Debug mode: 0 = true, 1 = inverted
DEFINE DEBUG_MODE 1
define DEBUGIN_MODE 1
'TRISA = 0
led1 var PORTA.0
led2 var PORTA.1
led3 var porta.2
led4 var porta.3
led5 var porta.4
x var byte
loop:
debug "hello world",cr ,10
for x = 255 to 1 step-5
pwm led1,x,10
if x < 60 then high led2
'if x < 25 then high led3
next x

When I compile amd program with ICD then click the play button it cannot connect

I can read the "hello world" on the Hyper Terminal
http://i404.photobucket.com/albums/pp129/mike2545_photo/CIMG2334.jpg

Any Ideas as to what is wrong?


Mike2545

Bruce
- 11th August 2009, 00:30
Serial communications with the ICD requires you to use the hardware USART.

Look in the MCS+ helpfile for ICD Serial Communcations.

Mike2545
- 11th August 2009, 01:32
Bruce, thank you for the response. If you don't mind, I just switched over from the Stamp, could you put that in more simple terms?

Bruce
- 11th August 2009, 02:11
You need a MAX232 interface between your PIC & PC, and you'll want to use HSEROUT
to display text from within MCS+ while running the ICD.

The MCS+ help file has instructions on using the ICD, and a full schematic. The ICD just
does not work without the MAX232 interface.