How to reed data from 18F4550 EEPROM into EXCEL via PC USB interface?


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have a look at the VB6 code in this project; http://www.rentron.com/PicBasic/PIC_USB.htm

    It shows how to display data coming from the USB PIC on labels, in a text box, log data to file with time/date stamp, etc..

    I never got around to completing the project page, but all VB & PBP code is in a .zip file for download.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Looks like a good approach to avoid having to learn details of VB6

    Quote Originally Posted by Bruce View Post
    Have a look at the VB6 code in this project; http://www.rentron.com/PicBasic/PIC_USB.htm

    It shows how to display data coming from the USB PIC on labels, in a text box, log data to file with time/date stamp, etc..

    I never got around to completing the project page, but all VB & PBP code is in a .zip file for download.
    Thanks so much for this, Bruce. I downloaded the zip and installed the files per the readme.txt. The readme was pretty explicit except it didn't say where in my file folders to place the vbskfr2.DEP file....can you tell me??
    I notice the LABXUSB.pbp and LABXUSB.hex files are for 18F4450. I am using 18F4550. I also notice in the .pbp code that no CONFIGS are set for the 18F4450, so I presume it is using default CONFIGS for a 18F4450. Besides the CONFIGS, are there any other differences in the .pbp code I should be aware of while I attempt to convert it to compile/assemble on 18F4550? I would just use a 18F4450 except it has no on chip EEPROM which I need for the data logging I am doing. Really appreciate your advice on this.

  3. #3
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Replace my previous post with this one...more detail/different questions for Bruce.

    Thanks so much for this, Bruce. I downloaded the zip and installed the files per the readme.txt, but in the process I have some questions:

    1) The readme was pretty explicit except it didn't say where in my file folders to place the vbskfr2.DEP file....can you tell me??
    2) As I understand it, the code in the zipped files is for an 18F4550, yet I see an 18F4450.INC file included in the zip.....how come? I would just use a 18F4450 except it has no on chip EEPROM which I need for the data logging I am doing. It is also a very old file (6/5/06) for version 2.47 so I presume I shouldn't replace the one in my PBP folder that is 09/12/08 Version 2.60 which I am using.
    3) I notice in the LABXUSB.inc file that the CONFIGS for an 18F4550 are listed for use with the bootloader but are commented out, so I presume it is using default CONFIGS for a 18F4550???
    4) I am programming my chips with a PICKIT2 rather than bootloader, so not sure what I have to do to the CONFIGS that are listed????
    5) I also notice that the 18F4550.bas file included in the zip is an older version for 2.46 (12/31/04) than the one in my PBP folder that is dated 9/12/08 for 2.6, ....and the older version has following files commented out:
    BANKA $0000, $005F
    BANK0 $0060, $00FF
    BANK1 $0100, $01FF
    BANK2 $0200, $02FF
    BANK3 $0300, $03FF
    'BANK4 $0400, $04FF
    'BANK5 $0500, $05FF
    'BANK6 $0600, $06FF
    'BANK7 $0700, $07FF
    'EEPROM $F00000, $F000FF
    'LIBRARY "PBPPIC18"
    LIBRARY "PBPUSB18"
    include "PIC18EXT.BAS"
    PORTL VAR PORTB
    PORTH VAR PORTC
    TRISL VAR TRISB
    TRISH VAR TRISC
    include "PBPPIC18.RAM"

    In the newer version this is the equivalent list and nothing is commented out:
    BANKA $0000, $005F
    BANK0 $0060, $00FF
    BANK1 $0100, $01FF
    BANK4 $0400, $04FF
    LIBRARY "PBPPIC18"
    include "PIC18EXT.BAS"
    PORTL VAR PORTB
    PORTH VAR PORTC
    TRISL VAR TRISB
    TRISH VAR TRISC
    include "PBPPIC18.RAM"
    USBMEMORYADDRESS Con $400 ' USB RAM starts here

    I presume since I am using PBP v2.6 compiler that I should not replace the 18F4550.bas file in my PBP folder with the one from the zip?? Should I comment out and of the BANK statements or change the LIBRARY to the one listed in the old file?

    Really appreciate your advice on this.
    Last edited by jellis00; - 27th May 2010 at 21:08. Reason: Delete one sentence

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Jellis00,

    This was done on a 4550 and compiled with PBP v2.47. Look in LABXUSB.INC for config fuse settings. I had these commented because I used Microchips USB boot-loader. You can get rid of the DEFINE RESET_ORG 800h since you're not using the USB loader. Note there are a few routines in the PBP code that were just experimental also.

    The 18F4450.INC was in there because someone requested it way back when I first put this together, and I compiled the Microchip USB loader for an 18F4450 for them.

    Just use the 18F4550.INC file you have, and set config fuses to the same as in the LABXUSB.INC file.

    The Readme.txt file has instructions for the vbskfr2.DEP and other related files. This is a VB skin program that gives the form the look it has.

    It's a lot of reading, but it's all there. If you're using PBP 2.6 look for the changes Darrel mentioned, and make sure you use whatever include files are with 2.6.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default That answers most of my questions...still 2 more

    Quote Originally Posted by Bruce View Post
    The Readme.txt file has instructions for the vbskfr2.DEP and other related files. This is a VB skin program that gives the form the look it has.

    It's a lot of reading, but it's all there. If you're using PBP 2.6 look for the changes Darrel mentioned, and make sure you use whatever include files are with 2.6.
    Thanks, Darrel...that clears up a lot of it.

    However, I looked again in the Readme.txt file and although it explicitly tells you where to place most of the files, there is no instruction where to place the vbskfr2.DEP file. Since it is a "dependency" file I'm not sure where it goes. I found some info here
    http://support.microsoft.com/kb/178354/en-us but it still doesn't say where to place the .dep file. Should it go into the PBP root folder or in my project file under the PBP root folder....or does it go somewhere in the Windows/system32 folder like the other files in the zip?

    Not sure what you are referring to in your statement "look for the changes Darrel mentioned"...he wasn't one of the posts in this thread. Are you referring to some other post of his?
    Last edited by jellis00; - 27th May 2010 at 22:30. Reason: Add dependency info.

  6. #6
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Why not use SD card ?, with the SD card you can create a CSV file and open it striaght up in excel. With SD card you can unplug oen insert another SD card to carry on taking the samples then you can just insert it to a card reader either fixed or usb sd card reader.
    That's the way I would do it

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    See this thread on USB changes to PBP 2.6: http://www.picbasic.co.uk/forum/show...5&daysprune=-1

    I haven't used USB with PBP 2.6 yet, but there have been changes, and you may need a newer version of EasyHID also.

    I dropped the .ocx in Windows/system, and just left the other vbskin files in the VB6 directory with the VB project files.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi, here are a few thoughts, some, all, or none of which might be of use.

    1) The folks at Parallax have a free application, PLX DAQ (earlier StampDaq) that directly takes in data from the serial port and inserts them in a spreadsheet; you might have to play around with the data frame structures; http://www.parallax.com/tabid/393/Default.aspx If you use the CDC mode, the app might be able to take your data directly from the virtual com port, eliminating a USB-to-serial chip / adapter.

    2) As Dave pointed out, again using CDC, you could spit out the data in your 3 columns in a 31 iteration loop, grab it on the PC with a terminal emulator (one that recognises virtual com ports), and simply copy-paste it into Excel. This technique I have tried (not with USB, with serial) to plot the discharge curve of a battery and works fine.

    3) Take a look at Windmill software, http://www.windmill.co.uk/ as also another product from Parallax, http://www.parallax.com/ProductInfo/...1/Default.aspx

    Regards,

    Anand

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts