Sending Data To Pc From Pic

Paolo1986

New Member
Hello all,

I am just enjoying playing with the PICAXEs and considering using Picaxe 28x2 in order to log temperature & humidity (say ever hour) on an Eeprom 24LC256/P 256K, using the i2c interface. I also want to view this data on my PC. I have read Picaxe manual 3 page 42-45 but still have some question. If you have done this before could you tell how you found it and how you visualised the transmitted data on your PC?

Q1? Is there any way that you can use a USB connection type instead of a serial connection?

Q2? What benefits does the MAX232 offer? Does Windows XP require the use of this additional IC?, does this affect communication reliability?

Q3? It also states ‘to use this system a communication software package is required for the PC’. Can this be notepad, Word maybe Excel?

Q4? What is handshaking? Does this have to be disabled in the program or in the compiler software?

If you can advise please do, if not thanks for reading
 

hippy

Ex-Staff (retired)
1) You can connect the serial from the PICAXE into a USB-to-serial interface ( such as the AXE027 used for download ), in fact, using SERRXD and SERTXD you can communicate solely using the download interface.

2) The MAX232 presents an industry standard RS232C interface for serial. Without it, the PICAXE serial is not truly RS232C compliant though works with the majority of PC's. Windows XP does not require it. Reliability can be improved using a MAX232 when using higher baud rates or using long cable runs.

3) The "communications software" is anything which can read from ( or write to ) the serial port. Normally applications such as HyperTerm, Terminal and any code you write yourself to do a similar job such as with VB.Net. VBA ( Visual Basic for Applications ) can provide some abilities for things like Excel and Word.

4) Handshaking is what tells one side the other is not ready to receive anything, so don't send it, and advertises data is available to be sent. The PICAXE doesn't have inbuilt support for handshaking and programs on the PC should be configured not to expect any nor use handshaking.
 

BeanieBots

Moderator
This type of thing has been done many times before with all sorts of different equipment, not just PICAXE.
There things available on the internet to help.
Look up "selmadaq" as just one example.

For simple datalogging, such as the PICAXE datalogger, the PE software contains a terminal type screen which can download the logged data. You can then copy it to a file to be analysed or whatever else you want to do.

If you have any further questions, there are plenty of people here to help.
 

Paolo1986

New Member
Hi all thanks for your responses been VERY helpful, I am firstly going to attempt this by using PLX-DAQ software for Excel as mentioned by xstamp in this thread;

http://www.picaxeforum.co.uk/showthread.php?t=6431&highlight=PLX-DAQ

Do you know how xstamp figured out the following code?

pause 1000
sertxd ("CLEARDATA",CR)
pause 1000
sertxd ("LABEL,X,Y,Z",CR)
pause 1000
sertxd ("MSG,StampDAQ Ramp Test.",CR)

Is this BASIC?

What is going on here?

Also does anybody have a sample code for sending data to the computer using the USB port?

First off I am going to buy and learn how to use the Eeprom 24LC256/P 256K, then I will try and integrate the two. I will update this thread once some progress is made.

Thanks again :)
 
Last edited:

slimplynth

Senior Member
1) You can connect the serial from the PICAXE into a USB-to-serial interface ( such as the AXE027 used for download ), in fact, using SERRXD and SERTXD you can communicate solely using the download interface.

2) The MAX232 presents an industry standard RS232C interface for serial. Without it, the PICAXE serial is not truly RS232C compliant though works with the majority of PC's. Windows XP does not require it. Reliability can be improved using a MAX232 when using higher baud rates or using long cable runs.

3) The "communications software" is anything which can read from ( or write to ) the serial port. Normally applications such as HyperTerm, Terminal and any code you write yourself to do a similar job such as with VB.Net. VBA ( Visual Basic for Applications ) can provide some abilities for things like Excel and Word.

4) Handshaking is what tells one side the other is not ready to receive anything, so don't send it, and advertises data is available to be sent. The PICAXE doesn't have inbuilt support for handshaking and programs on the PC should be configured not to expect any nor use handshaking.
Sending data using USB...as Hippy said in point (1) above, read up on sertxd in manual 2.
 

MFB

Senior Member
set-up code examples

Paolomdx, you might also be interested in another free software package from Selmaware called StampPlot Pro. I recently posted some example set-up code under the Projects section (title ‘Narrow-band radio telemetry’). Whereas SelmaDAQ exports logged data direct to Excel, StampPlot displays multiple (10 max) channels of incoming data in real-time. There is also the option of logging the incoming data onboard the PC for subsequent use by a spreadsheet.

I tend to use SelmaDAQ for downloading from data loggers and StampPlot Pro for radio telemetry and other real-time displays. Both packages require set-up code, which can be sent by the PICAXE (before the first data arrives) or entered manually via the PC keyboard. The SelmaWare web site provides extensive documentation on set-up and other features. Including optional in-line maths functions, which are a lot easer to use for scaling etc than trying to write PICAXE maths routines.
 

hippy

Ex-Staff (retired)
Do you know how xstamp figured out the following code?

pause 1000
sertxd ("CLEARDATA",CR)
pause 1000
sertxd ("LABEL,X,Y,Z",CR)
pause 1000
sertxd ("MSG,StampDAQ Ramp Test.",CR)

Is this BASIC?
That's an artefact of a change of forum some time ago; " is HTML mark-up code for double quotes, so the equivalent, correct, PICAXE BASIC code would be ..

pause 1000 : sertxd ( "CLEARDATA", CR )
pause 1000 : sertxd ( "LABEL,X,Y,Z" ,CR )
pause 1000 : sertxd ( "MSG,StampDAQ Ramp Test", CR )

This sends three configuration strings from the PICAXE to PC, spaced one second apart.
 
Top