Connecting PIC18F to PC??? please..

Discussion in 'The Projects Forum' started by st98, Mar 10, 2011.

  1. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Hi,

    I have a project using the PIC18F248. I am using a PIC PG1 programmer but I don't get to connect the development board PIC-P28 (OLIMEX) to the PC. I use MPLAB + Ccompiler software. How do I set it up to achieve connection and also do I use an external power supply (I do have one) or not? The connection between the board and the PC is made through a series USB to RS232 cable and the PIC PG1 programmer cable.

    Thanks You
    Stav
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    The PG1 is a JDM type programmer, it will not work with a USB to RS232 cable. You need a true RS232 port. That said it's also a very unreliable programmer even with a proper RS232 port.
     
  3. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    I suppose it would work with a true port then but which software could I use in that case? Are you saying it would be better if I buy an other programmer and if yes which one would you suggest?

    Thanks You
    Stav
     
  4. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    If you are starting with mcu(PIC) then you should use some kind of parallel port programmer with external power supply like this one :http://www.oshonsoft.com/picprog.html
    Yes you can use RS232 type of progammers, if they have an external power supply.
    Good Luck
     
  5. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Get a proper USB programmer, the PICkit2 or 3 or even my Junebug (PK2 compatible) are superior to any old serial / parallel device. They are also MPLAB compatible & have the debugger too (very handy)
     
  6. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Thanks for your reply.It would be better for me to use the easiest one at that state, only thing I want to achieve is to connect it to the pc and programme it. Is that possible with picprog?
    Thanks
    Stav
     
  7. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Just curious... why is that? What is a JDM type programmer?

    The only difference between a true RS232 Port and a USB/Serial is the voltage levels. The USB/Serial converters can input true RS232 levels but they output only +5V -5V. The only other issue (I know of) is at the PC end, where the TX & RX buffers are handled by the PC's memory instead of a UART.

    The only issue I've had with USB/Serial converters is during programming a Picaxe. This is because Picaxe uses the old "Break" command/signal during programming but not when running the program. I've tested a number of USB/Serial converters and only my old Belkin will not recognize 'Break'.

    For sure I'm not challenging your statement. I'm just not familiar with JDM type programmers. ;)
     
  8. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    Yes

    JDM are programmers which have no external power supply they get their power from the serial port (RS232) ,many PIC needs a high voltage (well known as Vpp) for progarmming now these JDM type programmers use serial ports voltage level to make this high voltage,normally using the dual signal level of the RS232 this can be done but some RS232 chip use new standard of voltage level for power saving (like in laptops) which cause JDM programmers not to work properly as they cant make the high voltage from very low signal level.
     
  9. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Yes, the voltage standard for RS232 has changed over the years and it's quite a bit lower than the original standard. I think the original standard was near +-30V but is now +-12V. If the OP needs the higher voltage to only power the pic why can't he use a separate supply, or are you saying that his PIC needs higher than 5V for programming signals too?
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I think the problems with "modern" serial ports are both voltage level, and current sourcing capabilities. I have also heard that a USB to serial converter can mess up the timing.
    The funny thing is that if you start from scratch and want to build a JDM programmer. The price tag will be close to a new PICKIT.
    Then the project are done:rolleyes:
     
  11. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Looking at this link.. http://www.instructables.com/id/Simple-JDM-PIC-Programmer/ I would not opt for using the TX Data line to also power the
    PIC. Personally, I would use the USB +5V supply and rout it over to the JDM. I would also think that scaling down the values of Rn in this circuit may be in order when using a converter. As for the converter not being capable of sourcing enough current ... My LoopBack tester has a Bi-color LED on each control and data pin. Three of the LEDS are lit at all times with moderate brilliance. Admittedly, not exactly an exacting limits test though. ;)
     
  12. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    PIC is programmed using a high voltage (Vpp) which is in a range from 9V to 13V.Now these days PIC are also having a low voltage programming option which only need 5V for both power and programming,but thats another thing(Vpp is still needed for many case).Here whats important is that in these JDM type programmer a PIC will need high voltage 9 - 12 Volt with 5V for power to be programmed.Now external power supply solves the problem but we also have to rebuilt the circuit,you just cant give Vpp to mcu to be programmed, it is a kind of switching signal which is given at proper time in programming time line.

    Many new standard for serial port gives a +/-3V range for signals.;)

    Current sourcing capabilities of new standard serial port is not much to worry about as PIC are CMOS device and they really sink and source very small amount of current at program time.:)
     
  13. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Thanks for filling me in on the requirements of these PICs. It's been enlightening and convinces me that there's a good reason that I love Picaxe! :D
     
Loading...