Author Topic: PIC ICSP programming vs socketed (Velleman Kit)  (Read 2885 times)

0 Members and 1 Guest are viewing this topic.

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
PIC ICSP programming vs socketed (Velleman Kit)
« on: November 14, 2013, 12:38:49 am »
As I mentioned in the thread about the 16C505 I built a working Velleman K8048 Serial programmer and I am using a real serial port, not a serial over USB port. I've had experience programming bare AVRs before but have only been messing with PICs for a week or two.

The board itself has sockets for 8, 14, 20 (I think), and 28 pin DIP chips and an ICSP header (5 Pins).

I'm interested in using the ICSP header to read a PIC 18F25K22 (or could be 18F26K22) that is in an existing product (OBDII Bluetooth dongle)  The cable has unpopulated ICSP plated holes (5 pins)

When using a socketed PIC on this programmer, I can select "Run, Program or Standby" with the toggle switch and it seems to work as such for socketed chips, however when I did wire up via the ICSP circuit, the PIC appeared to be running its program as the LEDs on the cable were blinking like they would on startup and I would get the same sequence via either Run or Program, so I'm guessing the ICSP header doesn't use that switch other than cutting power in standby mode.

If I try to read the pic with PicPgm (with Velleman K8048 selected) the status lights on the cable flash like TX/RX lights on a modem and the software says no PIC detected.

So that tells me that like an AVR there's a pin that needs to be pulled high or low for the PIC to respond in programming mode. I flipped through the datasheet on this chip but I didn't see anything about programming. But I assume there's some basics that apply to most PICs like the basics on the AVRs.

The dongle is sort of like this:

[OBDII PORT] -> [MCP2551 CAN Interface] -> [PIC18] -> [FTDI or BT Module]
Depending on the BT or USB version of the cable, there's either an FTDI chip or a all-in-one BT module connected to the chip. There are also 4 or 5 status LEDs that are not labled as to what they indicate and a 4MHz crystal. One status LED is definitely power, 2 seem to be TX/RX and the others I'm not sure.

So as this device is in-circuit, do you think I can still pull a pin high / low to read it?
« Last Edit: November 14, 2013, 02:10:21 am by Stonent »
The larger the government, the smaller the citizen.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: PIC ICSP programming vs socketed (Velleman Kit)
« Reply #1 on: November 14, 2013, 12:54:18 am »
There's a circuit diagram with the kit - so you can work out what connects to what. If I remember correctly, the ISPC cable connector is wired straight-through to the same pins as the programming sockets on the K8048.

One caveat to be aware of: The low-programming voltage pin (RB3 - I think) on the target PIC must be pulled to its inactive state when programming.  All the Microchip ISPC cables are six-way - the extra signal connects to the low-voltage programming pin.
 

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: PIC ICSP programming vs socketed (Velleman Kit)
« Reply #2 on: November 14, 2013, 02:15:35 am »
Yeah I think that's why this kit runs on +15V and needs a real RS-232 port using the 12V peak to peak voltage.

As I don't currently have a 15 volt supply I've been using two dry-cell 9V batteries in series and it seems to be ok. It's maybe a volt high but hopefully within a safe range.
The larger the government, the smaller the citizen.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: PIC ICSP programming vs socketed (Velleman Kit)
« Reply #3 on: November 14, 2013, 02:58:58 am »
Yeah I think that's why this kit runs on +15V and needs a real RS-232 port using the 12V peak to peak voltage.
It doesn't use the RS232 standard -  it just uses the port to bit-bang the ICSP signals. Signals from the PC have to have enough volts to turn-on a bjt. Signals to the PC are 0 to 5V.

The Run/Off/Prog switch connects Vcc in either active position. In the Prog position it also connects the target reset line to Vpp.  I think the catch is that you need Vpp present even if all you want to do is read the device.  The on-board Vpp level is derived via 7812 regulator from the DC input jack.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf