Searching \ for '[OT] Seeprom + VB + PC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=eeprom
Search entire site for: 'Seeprom + VB + PC'.

Exact match. Not showing close matches.
PICList Thread
'[OT] Seeprom + VB + PC'
1999\11\20@024953 by Tim Hamel

picon face
PICsters,

This isn't all that OT because the end result IS with a PIC. I'm hoping there
are VB programmers out there that have tried to do this... I'm wanting to
program some SEEPROMs via my printer port, but my only language is Visual
Basic. I've studied Peter Anderson's code only to be left with a big "?" on
my forehead. Sure, I could use someone else's code, but I want to know what's
going on. Has anyone done this using VB? I know it's possible... Any info is
much appreciated.

Thanks in advance,

Tim Hamel

1999\11\20@050914 by Darren Logan

picon face
I have VBX'x that allow you to read/write to any port in the PC.

They're for VB4 16-Bit.

1999\11\20@051330 by Tim Hamel

picon face
I appreciate the offer...but I use VB6 and a DLL to access ports. I don't
have a problem with clocking (low...high), all I have a problem with is
actually sending data TO the eeprom -- shifting it, OR'ing it with a bit to
keep CS high, etc.

Tim Hamel

In a message dated 11/20/99 2:09:26 AM Pacific Standard Time,
spam_OUTDAZLOGANTakeThisOuTspamAOL.COM writes:

> I have VBX'x that allow you to read/write to any port in the PC.
>
>  They're for VB4 16-Bit.

1999\11\20@053101 by Robert A. LaBudde

flavicon
face
<x-flowed>At 02:47 AM 11/20/99 -0500, Tim wrote:
>This isn't all that OT because the end result IS with a PIC. I'm hoping there
>are VB programmers out there that have tried to do this... I'm wanting to
>program some SEEPROMs via my printer port, but my only language is Visual
>Basic. I've studied Peter Anderson's code only to be left with a big "?" on
>my forehead. Sure, I could use someone else's code, but I want to know what's
>going on. Has anyone done this using VB? I know it's possible... Any info is
>much appreciated.

1. WinNT will not allow you to access the parallel port. You must install a
Win device driver that gives you permission. These are available on the
internet.

2. In Win95 and Win98, you can access the parallel port, but VB does not
have the facilities to do so. You must install a C-based DLL to give VB the
capability. There are freeware DLLs of this type available on the parallel
port info sits.

3. The typical parallel data port is 0x'378'. Pins 2-9 of the connector are
D0 ... D7.

4. Inputs are available from the status port at 0x'379'.

5. Ground is at pin 18 of the connector.

6. I've driven a PIC 16F84 and LEDs just by plugging a few PIC input lines
into the parallel port data-out lines! Apparently you can get > 10 mA per pin!

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam@spam@lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\11\20@053728 by Tim Hamel

picon face
I apologize for not being clearer in some areas. I have experience with the
parallel port, it's just this one thing that's got me stuck. To be exact.. to
read a byte from the EEPROM, the opcode is 110000000b Ok, now, I'm using Pin
2 of the parallel port (which is bit 0 of 0x378), so my question is...how do
I flip that value around so it's 000000011b  so that I can start
outputting/shifting it? That's my exact problem right there!

Much Thanks,

Tim Hamel


In a message dated 11/20/99 2:31:23 AM Pacific Standard Time, ralspamKILLspamLCFLTD.COM
writes:

{Quote hidden}

1999\11\20@055627 by Robert A. LaBudde

flavicon
face
<x-flowed>At 05:11 AM 11/20/99 -0500, Tim wrote:
>I appreciate the offer...but I use VB6 and a DLL to access ports. I don't
>have a problem with clocking (low...high), all I have a problem with is
>actually sending data TO the eeprom -- shifting it, OR'ing it with a bit to
>keep CS high, etc.
>
>Tim Hamel

1. VB operations:

OR:     iResult = iOper1 or iOper2

AND:    iResult = iOper1 and iOper2

XOR:    iResult = iOper1 xor iOper2

Right shift 1-bit:  iResult = iOper1 \ 2

Left shift 1-bit:   iResult = iOper1 * 2

E.g.   iResult = (iOper and &Hf7) or &H10

2. Work on bytes individually, and use INTEGER variables (16-bit) to hold
numbers. This will avoid sign extension problems.

3. Output the 16-bit integer to the port (8-bits). Only the low 8 bits will
be sent.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam.....lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\11\20@060617 by Robert A. LaBudde

flavicon
face
<x-flowed>At 05:36 AM 11/20/99 -0500, Tim wrote:
>I apologize for not being clearer in some areas. I have experience with the
>parallel port, it's just this one thing that's got me stuck. To be exact.. to
>read a byte from the EEPROM, the opcode is 110000000b Ok, now, I'm using Pin
>2 of the parallel port (which is bit 0 of 0x378), so my question is...how do
>I flip that value around so it's 000000011b  so that I can start
>outputting/shifting it? That's my exact problem right there!

Presumably you meant 1100 0000 for the value, as your's above is 9 bits.

To output bit-by-bit starting with msb:

        iDiv=2^7
        for iPos=7 to 0 step -1
          iBit=iData \ iDiv     'this will be 0 or 1 for bit in position i
          call OutPort(&H378,iBit)
          iDiv=iDiv \ 2         'shift to next lowest bit
       next iPos

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: EraseMEralspam_OUTspamTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\11\20@061852 by Tim Hamel

picon face
You are the man! =) I guess the "step -1" REALLY makes a difference. As far
as the EEPROM goes, it is 9 bits (Start bit + Opcode (2 bits) + 6 bit
address). Now, all I do is OR the value that goes out to 378 with 2 and CS
will be high constantly. Woohoo! I thank you VERY much!

Tim Hamel


In a message dated 11/20/99 3:06:32 AM Pacific Standard Time, ralspamspam_OUTLCFLTD.COM
writes:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...