Previous in Forum: Request for: Fishing Hobbies user group   Next in Forum: "best" wicking/capillary material?
Close
Close
Close
7 comments
Rate Comments: Nested
Power-User

Join Date: Jul 2008
Location: Adelaide, Australia
Posts: 403
Good Answers: 14

Using Visual Basic to change EEPROM in an 18X Picaxe

09/07/2008 9:34 PM

I'm making a medical pump unit, which I want the owner to be able to reprogram via a laptop.

All of the reprogrammable information will be variables stored in the EEPROM of an 18X Picaxe. I would like to communicate via the laptop USB port and write a VB program as a user friendly front end. I am aware I need to use the SERIN and SEROUT commands in Picaxe, but I'm a bit lost from there on.

Any tutorials or examples would be appreciated.

__________________
The nice thing about Standards is there are so many to choose from.
Register to Reply
Pathfinder Tags: EEPROM Picaxe 18X Visual Basic
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Commentator
Indonesia - Member - Member from Indonesia Hobbies - Fishing - New Member Engineering Fields - Electrical Engineering - Member

Join Date: Aug 2008
Location: Batam, Indonesia
Posts: 85
Good Answers: 1
#1

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/08/2008 5:40 AM

Tonymech, i hope this article can give you an idea.

en.wikipedia.org/wiki/I²C

__________________
Fear of God is the beginning of knowledge, God bless you.
Register to Reply
Power-User

Join Date: Jul 2008
Location: United States of America
Posts: 429
Good Answers: 3
#2

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/09/2008 7:14 AM

I did a bit of research on this issue beginning with finding an answer to an aspect of your question: "Can the Basic Paradigm be embedded in VB Paradigm?" and I could not find a conclusive information. I found however than there are interpreters that translate Basic Paradigm into the C-Paradigm before compilation therefore enabling interface with other C-paradigm programs.

May be you may want to consider building the interface in C/C++, programme the microcontroller in Basic Paradigm, translate that Basic program into the C and finally compile the combined program.

The programming of the microcontroller, needless to state, is discussed in the accompanying manuels and simply requires critical/analytical reading.

Just a suggestion

__________________
EditorGBAnalysts - Give a boy fish and he will eat may be for a day, but teach him how to fish and he will eat everyday.
Register to Reply
Power-User

Join Date: Apr 2008
Location: UK
Posts: 246
Good Answers: 6
#3

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/09/2008 11:29 AM

Tony you can get the picaxe chip to read a serial input say a variable 0-255 from the serial port and store it in its memory. So in principle you could program the pc in VB6 to read a request from the picaxe 18 for an input and then send the appropriate number for it to read. How many variables are you storing and what values are likely. If you had say 6 variables to read you could send them individually on request by responding to preset outputs from the chip. The sertxd command on the picaxe 18x is easy to use e.g.

b0=1

sertxd b0

will send 1 to the serial port.

A write# command looped in VB would then be used to write an output to the port corresponding to requested variable. The picaxe could read this with serin as you say. Just got to get the baud rate and connections right. The input pin could share the programming pin on the chip. Its not trivial but can be done depends on your knowledge of VB. I am talking VB6 can`t say about VB in Excel. You also need the Mscomm library tools which I don`t think are included in cut down versions of VB.

__________________
Peter Jensen
Register to Reply
Power-User

Join Date: Jul 2008
Location: Adelaide, Australia
Posts: 403
Good Answers: 14
#4
In reply to #3

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/09/2008 7:51 PM

Thank you Pj3ns3n,

0-255 is adequate for all the variables and EEPROM can store 256 bytes, I only need about 20, it is easy to retrieve them using READMEM and plug them into b0, b1 etc. I will be using VB6, if you have done it before, do you have any code examples for either the 18X and/or VB6. I will be using a USB connection, but I believe that simulates the comm connection, I'll get it working with comm first. Do I need a different connection or will the programming cable do it.

__________________
The nice thing about Standards is there are so many to choose from.
Register to Reply
Power-User

Join Date: Apr 2008
Location: UK
Posts: 246
Good Answers: 6
#5
In reply to #4

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/10/2008 4:12 PM

Tony

I have never sent data to the serial port but have made VB6 programs to read the port. It should be similar but one thing to note the baud rate etc settings for the programming cable input and sertxd output are (4800,N,8,1) whereas the picaxe input/output pins for serin work at (2400,N,8,1). You may be better off making up a new cable and avoiding the picaxe programming cable for data transfer and do it all at 2400. I can let you have the code etc for a graphplotter I made for you to look at if you give me your e-mail address. It may take me a day or two to dig it out. I don`t think the USB interface will make any difference but have not tried it with USB to serial cable adaptor.

__________________
Peter Jensen
Register to Reply
Power-User

Join Date: Jul 2008
Location: Adelaide, Australia
Posts: 403
Good Answers: 14
#7
In reply to #5

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/10/2008 6:17 PM

Thank you Pj3ns3n, for your help, my email is tony@backassist.com.au

__________________
The nice thing about Standards is there are so many to choose from.
Register to Reply
Power-User

Join Date: Apr 2008
Location: UK
Posts: 246
Good Answers: 6
#6
In reply to #4

Re: Using Visual Basic to change EEPROM in an 18X Picaxe

09/10/2008 5:17 PM

This site is pretty good on the interfacing. Like it says use a switch to change from Program Editor programming to interfacing to make life simple.

http://www.hippy.freeserve.co.uk/picaxeio.htm#Sertxd

__________________
Peter Jensen
Register to Reply
Register to Reply 7 comments
Copy to Clipboard

Users who posted comments:

editorgbanalysts (1); Jusup (1); Pj3ns3n (3); Tonymech (2)

Previous in Forum: Request for: Fishing Hobbies user group   Next in Forum: "best" wicking/capillary material?

Advertisement