How to reed data from 18F4550 EEPROM into EXCEL via PC USB interface?
I have spent the last hour searching the forums for an answer to this question and have finally given up and decided to post this new thread. Lots of discussion about such a datalogging application using RS232 or serial but very little if any on how to do this with USB. Here is what I want to do...any referralls to threads or WEB tutorials on any of the pieces of this application would be appreicated:
1) Data measurements (one word, once per day) are stored with the date value are stored by an 18F4550 based microcontroller into the MCU's EPROM memory for 31 days.
2) On monthly cycle a USB cable is connected to the 18F4550 based microcontroller to download the data to a laptop.
3) Need a VB6 program on the laptop as the PC side of the USB interface and to insert the collected data into 31 rows of three columns each (date, Data_LSB, Data_MSB) on an Excel spreadsheet.
4) Need to also read the RTC date/time (DS1337) from the microcontroller into the VB6 program at time of USB connection where user can reset the RTC time from the VB6 program if the read time isn't within timing tolerances.
Would prefer to do this with PBPro and not assembly. I have Darrel Taylor's and Mister-E's VB6 HIDs and have attempted to adapt them to provide the PC side of the USB interface, but still stuggling with how to have it read the 31 days of EEPROM data in a sequence that can easily be inserted into an EXCEL spreadsheet in the format desired.
Any help on this would be greatly appreciated and I will share back the results when finished.
How does your terminal program dump into Excel??
Quote:
Originally Posted by
Dave
jellis00, I do exactly that, I have 4, 24F1025's that I save data to and when requested by the host (PC) thru a terminal program. I dump the contents of the eeproms to it in CSV format (Comma Seperated Variable) which Excel will accept without any problems. I then use this data for presentation in Excel.
Dave, I would very much appreciate learning moe about how you implemented the PC side of your interface to receive and dump the data to Excel. Can you elaborate? Sounds like you use some kind of teerminal program rather than VB6 and I am curious as to how you get the terminal program to parse the BufferIn() contents from the PIC sent array and store it into Excel.
Looks like a good approach to avoid having to learn details of VB6
Quote:
Originally Posted by
Bruce
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.
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.
That answers most of my questions...still 2 more
Quote:
Originally Posted by
Bruce
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?
Reference is to Parallax or Windmill?
Quote:
Originally Posted by
chuck
I was going to suggest that, But you would have to get written permission for bussiness use has you can us it and alter it for free for private use. If i remember there is one file that cannot be altered due to copyrights.
May be worth e-mailing them to ask and see what they say
Thanks, Chuck for ideas. Are you referring to Parralax or Windmill?
Will it work with USB interface?
Quote:
Originally Posted by
chuck
I was referring to Parralax has this is a freeware not sure about the windmill software.
I've used the Parralax many of times and it really easy to use.
Thanks, Chuck. As I have said before, however, I must use it on a USB intereface for this particular application. Have you (or anyone else that might answer) ever been able to get Parralax to work with a USB interface between the PC and the PIC?? If I can verify that is doable I am going to give it a try.