View previous topic :: View next topic |
Author |
Message |
mkossor
Joined: 28 Dec 2009 Posts: 7
|
Can PIC16F690 Data EEPROM be read directly from VB6? |
Posted: Tue Aug 03, 2010 8:25 pm |
|
|
I am interested in a way to read a PIC16F690 data EEPROM using the PC USB port (or serial or parallel port) from the PIC programming pins (ICSPCLK, ISCPDAT) NOT via RS232 communications pins TX/RX; I have done it that way before.
Would be interested if anyone has done the HW and SW for this or knows how it can be done with VB6. Thanks! |
|
|
jbmiller
Joined: 07 Oct 2006 Posts: 73 Location: Greensville,Ontario
|
|
Posted: Tue Aug 03, 2010 8:52 pm |
|
|
There's nothing to stop you from using the I/O pins that are muxed as ICSPCLK and ISCPDAT to be serial I/O (aka RS232) and program the chip to accept commands from a PC (using VB6) to read the EEPROM within the PIC.
Now if you mean 'Can I read the EEPROM of a preprogrammed PIC, using VB6' the answer is yes. The PICSTART Plus programmer does this (as do most programmers).
All you need to do is read up on the datasheets, cut code, try it, repeat until you get it to work right. I gave up on VB6 (way too slow, too much overhead,etc.) went to Delphi as I need tight, efficient code so I can't offer how you can cut the VB6 side, but it isn't that difficult, just a bunch of bit banging a COMport or parallel port (if you have an 'old' PC !). |
|
|
mkossor
Joined: 28 Dec 2009 Posts: 7
|
RE: Can PIC16F690 Data EEPROM be read directly from VB6? |
Posted: Wed Aug 04, 2010 8:57 pm |
|
|
Thank you for the reply. I am looking for a way to read the data EEPROM of a pre-programmed PIC using the programming pins (ICSPCLK and ICSPDAT) directly from a laptop with a VB6 GUI - No programmer involved, no RS232 data communications code running on the PIC.
Just read the data EEPROM from the programming pins directly to laptop via USB connection (+5V, data, and clock) perferred but could use parallel port if necessary.
I am sure it can be done because the programmer can read the EEPROM via those pins without any RS232 configuration being programmed in the PIC. Don't want to re-invent if someone has done this and could share the solution. Thanks |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
|
Posted: Wed Aug 04, 2010 9:22 pm |
|
|
It could be done using the parallel port. You need to read the programming specs for the mcu, then implement the reading sequence for the EEPROM. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Aug 05, 2010 2:11 am |
|
|
There are some basic 'parallel port' programmers on the web, which have code to do this. In a few cases the code may be originally in VB6, and in a very few cases the source may also be available.
All of this (of course), assumes that no code protection is present....
Best Wishes |
|
|
mkossor
Joined: 28 Dec 2009 Posts: 7
|
|
Posted: Fri Aug 06, 2010 9:00 pm |
|
|
Do you have any links to the programs you mentioned? I am looking for VB6 source and really don't want to re-invent the application. Please let me know if you have any links to VB6 based programmers with Source.
Thanks!
Mike |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE |
Posted: Fri Aug 06, 2010 9:27 pm |
|
|
A google search yielded numerous links, these provide a basic idea of how the parallel port could be used via VB.
http://www.aaroncake.net/electronics/vblpt.htm
http://www.thaiio.com/prog-cgi/0006_vb.html
Obviously you cannot access the parallel port directly from VB, a DLL is needed to do this. The Win95IO.dll works very well.
Its quite easy to build a parallel port programmer if you have some basic knowledge of electronics.
See these links, they show how a parallel port programmer could be built, the site contains source code and schematics. The serial port programmer looks interesting.
http://www.rentron.com/Myke4.htm
The above links provide useful info on building a programmer, you need to modify the system for your own requirement (programming only the EEPROM part).
Since you are keen on USB, why not make a program that accepts USB packets from the PC via USB. You could send a packet containing the location (where the data ha to be written) and the data. The firmware identifies the packet as a EEPROM write command and, then writes the data at the specified location.
thanks
a |
|
|
mkossor
Joined: 28 Dec 2009 Posts: 7
|
RE: Can PIC16F690 Data EEPROM be read directly from VB6? |
Posted: Mon Aug 16, 2010 4:07 am |
|
|
arunb, Thank you for the useful links to VB based progarmmers. They should provide the information needed to build a VB EEPROM reader I am looking for via serial or parallel port.
The suggestion you offered on a USB based programmer sounds very intersting and desireable, however, I am not that familiar with the details associated with USB interface you referenced so may opt to deferr pursuit of that method since more detailed information on how to implement the serial or parallel port method already exists on the web. Please let me know if you come accross any existing examples of how to implement a USB based VB programmer. Thanks again for your helpful post. Regards, Mike |
|
|
mkossor
Joined: 28 Dec 2009 Posts: 7
|
RE: Can PIC16F690 Data EEPROM be read directly from VB6? |
Posted: Mon Aug 16, 2010 4:21 am |
|
|
arunb, The serial port programmer reqires additional hardware to interface to the PIC. I was hoping it could be done directly from the USB port very similar to what you described. I only need to read the EEPROM NOT write to it so would expect it should be possible to control the USB ports 4 pins (+5V, ground and 2 I/O pins) to power up the PIC and control ICSPCLK and ISCPDAT to send EEPROM read commands for specific addresses of EEPROM via a VB6 GUI. I was hoping someone had already done this application (or very similar). Do you know of a good reference I could get to help me implement the USB solution you proposed? (complete USB perhaps?) Thanks for your assistance, Mike |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Mon Aug 16, 2010 5:12 am |
|
|
No way....
The USB port, does not allow you to directly access the clock and data lines. It has it's own control chip, that _requires_ the device at the other end to reply in specific ways. To do this with USB, you would need a USB 'slave' (a PIC possibly with this hardware), that then operates the required lines to talk to the EEPROM.
The parallel port, is the only 'standard' port on the PC, that allows direct access to lines.
Best Wishes |
|
|
mkossor
Joined: 28 Dec 2009 Posts: 7
|
RE: Can PIC16F690 Data EEPROM be read directly from VB6? |
Posted: Mon Aug 16, 2010 2:55 pm |
|
|
Ttelmah, Thank you for the issues with a direct USB solution. Looks like the parallel port is the way to go. Would likely add a buffer between the port and the PIC just as a safety precaution to protect the PC/port. I will leverage the parallel port programmer code a much as possible. Thanks! |
|
|
jbmiller
Joined: 07 Oct 2006 Posts: 73 Location: Greensville,Ontario
|
|
Posted: Mon Aug 16, 2010 3:06 pm |
|
|
If your PC has a real RS-232 comport, you can directly access the control lines to read the chip. There was an AP note about controlling and A2D chip this way, using QuickBasic several years ago.
I do know that Delphi can do this 'trick'.
Another alternative is to get an 'old' PC with Windows 98 SE on it, that I know will do what you want, at least with QuickBasic. |
|
|
|