PDA

View Full Version : Pulsin and ICD



Ramius
- 20th May 2012, 17:51
Hi All!
Again I have the infamous IDC timeout. I believe the wiring is correct and just in case , maybe I missed something in the code? Thanks, Ed

'************************************************* ***************
'* Name : SERVO ANGLE.BAS *
'* Author : Ed Cannady *
'* Notice : Copyright (c) 2012 Copyright (c) 2012 *
'* : All Rights Reserved *
'* Date : 5/20/2012 *
'* Version : 1.0 *
'* Notes :16F628A *
'* : *
'************************************************* ***************
Include "Modedefs.bas"
Define LOADER_USED 1

' ** Set Xtal Value in mHz **

Define OSC 20 ' Set Xtal Frequency

' ** Declare Pins Used **

CMCON=7
INPUT PortA.0 ' Data is clocked on rising edge of this pin

' ** Variables **
Rawpulse Var Word ' Measured input pulse width
Trueangle Var Word ' Calculated Servo Angle

' ***** MAIN PROGRAM *****

Again:
Pulsin PORTA.0,1,Rawpulse ' Measure the input pulse width on pin 17 (RA0)
Trueangle=(((Rawpulse-15)*18)*100) ' Calculate Servo position angle
pause 150

goto Again

HenrikOlsson
- 20th May 2012, 18:08
Hi Ed,
I suspect you mean the MicroCodeStudio ICD?
Do you have the MAX232 circuit as per the description (http://www.mecanique.co.uk/code-studio/icd/ICDHardwareSetup.html), do you have the correct chip selected in the drop down list and have you programmed the chip with the .hex file compiled FOR ICD operation (by clicking the ICD compile button, not the normal Compile button)?

Are you bootloading the PIC? If so, and if THAT works, then the MAX232 circuit and hardware is verified to be OK.

/Henrik.

Ramius
- 20th May 2012, 18:34
Hi Henrik!
There is just something very basic I seem to be missing somewhere. Yes, the MAX232 circuit is good and has been working for a very long time. I can go into Microcode Studios, open the comm screen, jumper the Rx to the Tx on the MAX232 output, connect, type something in and it returns! Yes I have been using the ICD compile. I just wish the IDC error message was more exact! Best, Ed

Ramius
- 20th May 2012, 20:18
Bad resonator!:blue: