Picaxe 08M with 64 megabytes of memory

moxhamj

New Member
64Mb to 2Gb of memory. Very simple interface. The program below demonstrates writing one byte to a location in ram and then reading it back. Schematic attached. Works at baud rates of 300 to hundreds of k, but tested at 2400 because this is simple for an 08M.

Traps - watch that you don't bump the top of the memory module otherwise the ram chip can half pop out and then it doesn't work.

Code:

high 1 ' must start with a high
pause 1000 ' wait for module to boot (300-400ms)
serout 1,T2400,("U") ' sets baud rate to whatever send U at
serin 2,T2400,b13 ' read back ack or nak
w1=123 ' set up address msb to lsb = b3,b2,b1,b0 w1*65536+w0 0-64Mb or up to 2Gb
w0=3124
serout 1,T2400,("@A",b3,b2,b1,b0) ' set address to write to/read from
serin 2,T2400,b13 ' read back ack or nak
b4=37 ' test byte to write
serout 1,T2400,("@w",b4) ' write a byte - this increments counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@A",b3,b2,b1,b0) ' resend the address counter
serin 2,T2400,b13 ' read back ack or nak
serout 1,T2400,("@r") ' read a byte
serin 2,T2400,b13 ' get the byte to read back
debug ' display it
 

Attachments

nbw

Senior Member
I like the look of these... that would make one heck of a datalogger. The USD30 tag is kinda pricey.

Would it be possible to easily address all of say, 512Mb given our below picaxes can only 'easily' handle numbers up to 65535?
 

MORA99

Senior Member
I like the look of these... that would make one heck of a datalogger. The USD30 tag is kinda pricey.

Would it be possible to easily address all of say, 512Mb given our below picaxes can only 'easily' handle numbers up to 65535?
You use 4bytes to set the byte to be read/written, see lines 5-7 in the example code.
 

MORA99

Senior Member
I have been using a Rogue Robotics 1613 uMMC SD and MMC Memory Card Interface module from Hobby Engineering, which is a little more expensive than the 4DSystems module, but has the advantage of not needing the 08M to drive it, if a serial interface is what you need.
See my project "A Secure Digital Writer" and http://www.worsleyassociates.com/Projects/SDWriter/index.html?
Does that do any FAT encoding ?
I have been working with the vdrive for a while, and considered serial speeds, even a few mb will take a _long_ time at any serial speed.

If I understand correctly 9600baud means 9600bits per second = 9kb ?
115200baud = 112kb
If thats correct, even 200mb would take 30minutes at 115200baud to download ?

(yes 200mb is alot if we stay with the binary encodings, but if we take advantage of having lots of space and generate ascii csv log files, that anything can read, they get huge fast)
 

BCJKiwi

Senior Member
Check out the uAlfat - full USB or SD or Micro SD (depending on the model), FAT, serial, i2c and SPI interfaces.

Use the uAlfat-TF myself (TF = TransFlash=microSD)
 

MFB

Senior Member
Help with uDrive please

I have tried to use Dr_Acula’s uDrive test code on an 8MHz 40-X1 without success. Although the uDrive returns ack and seems to respond sensibly to a Version/Device Info Request, an (“@r”) command always returns a value of 0. The card is a brand new 256M, sold by a company called pq1 through Maplin in the UK. Does anyone know of a way to check for a faulty card with the uDrive?

I would also very much welcome some general advice on using this interface. The documentation states, “The address location pointer is automatically incremented to the next address location”. Is this only when writing 512 blocks of data, or does it also apply when writing single byte? For example, is it possible to set the address counter to some low value and then write (“@w”) 2M bytes of data to the card and stop, then reset the counter to the original address and read (“@r”) back 2M bytes of data?
 

jmumby

Senior Member
I have played at length with this drive. Here is a sample code that work so you should try it

Code:
SYMBOL RESET_PIN = 6
SYMBOL uDrive_TX = 7
SYMBOL uDrive_RX = 0
SYMBOL uDrive_Baud = T2400_16

'SET ADDRESS
SEROUT uDrive_TX,uDrive_Baud,(0x40,0x41,0x00,0x00,0x00,0x00)
' WAIT FOR ACK (remove for speeds above 2400)
SERIN [3000,ERROR],uDrive_RX,uDRIVE_BAUD,(0x06)  

'WRITE BYTE B1
SEROUT uDrive_TX,uDRIVE_BAUD,(0x40,0x77,B1)
' WAIT FOR ACK
SERIN [3000,ERROR],uDrive_RX,uDRIVE_BAUD,(0x06)

'READ BYTE IN B3 (no ACK)
SEROUT uDrive_TX,uDrive_Baud,(0x40,0x72)
SERIN uDrive_RX,uDrive_Baud,b3
If your using bit banged serial than I wouldn't bother waiting for an ACK as the drive is too quick for the Picaxe. Mainly because halfway thru the picaxe executing serin the uDrive has sent the ack so you get a about 4 bit's of the byte. http://www.websitetoolbox.com/tool/post/4d/vpost?id=2596766

Also a neat trick I used for my data logger. I updated a WORD with the address after each write (as it seemed to loose it's place with consecutive writes) then wrote that address in the first bytes of the uSD card every 100 bytes or so, every time I started logging it started to write from where it had left off.

This might wear out an uSD card with this method so maybe have a shut down routine to do this. Worked ok for me as I just wanted to turn my logger on and off at whim and let it autonomously look after itself. http://www.picaxeforum.co.uk/showthread.php?t=9058.

This is some snippets from a larger program should give you the gist.

Code:
SYMBOL uDrive_TX = 1
SYMBOL uDrive_RX = 4
SYMBOL uDRIVE_BAUD = T4800_16
SYMBOL ECHO_BAUD = T4800_16
SYMBOL UW = W12 'B24 B25
SYMBOL LW = W13 'B26 B27
SYMBOL GREEN_LED = 6
SYMBOL RED_LED = 7
SYMBOL DATA = B1

' Read in bytes 0,1,2,3 from SD card and load in registers B24-B27 
LOAD_ADDRESS:
SERTXD(CR,LF,"LOADING ADDRESS",CR,LF)
 SEROUT uDrive_TX,uDRIVE_BAUD,(0x40,0x41,0x00,0x00,0x00,0x00)
  WAIT 3
   SEROUT uDrive_TX,uDrive_Baud,(0x40,0x72)
    SERIN uDrive_RX,uDrive_Baud,B25
     SEROUT uDrive_TX,uDrive_Baud,(0x40,0x72)
      SERIN uDrive_RX,uDrive_Baud,B24
     SEROUT uDrive_TX,uDrive_Baud,(0x40,0x72)
    SERIN uDrive_RX,uDrive_Baud,B27
   SEROUT uDrive_TX,uDrive_Baud,(0x40,0x72)
 SERIN uDrive_RX,uDrive_Baud,B26

'Write DATA to drive using the address from the card
WRITE:
SEROUT uDrive_TX,uDRIVE_BAUD,(0x40,0x41,B25,B24,B27,B26)
SEROUT uDrive_TX,uDRIVE_BAUD,(0x40,0x77,DATA)
SERIN [5000,INIT_SNOOP],uDrive_RX,uDRIVE_BAUD,(0x06)
GOSUB INCREMENT
END

'Might be a nicer way of doing this but this seemed to work.
INCREMENT:
LOWER_WORD:
 INC LW
  IF LW = 65535 THEN GOTO UPPER_WORD
   RETURN
    UPPER_WORD:
  LW = 0
 INC UW
RETURN
As for FAT support. I think my attitude towards product is well known by now http://www.picaxeforum.co.uk/showpost.php?p=90905&postcount=2. So I have side graded to DosOnChip http://www.sparkfun.com/commerce/product_info.php?products_id=8226. I haven't got this work much further than making a directory as the makers have pulled all documentation and released a new FW which is consistent with nothing.

If your skills at reading 'C' are better than mine perhaps you could download the API http://dosonchip.com/support/assets/DOSONCHIP_API_1.02.zip and try and decipher how to get this thing to work on Picaxe!


Hope this helps
 
Last edited:

MFB

Senior Member
Thanks

jmumby, many thanks for the quick and helpful response. I’m a bit stuck with a questionable card at the moment, but will certainly try your code with a new one later today and let you know the results.
 

MFB

Senior Member
The 4D System forum moderator (link from jmumby) states that the address pointer defaults to 0x00000000 on power up/reset and suggests a very simple test that involves writing a single byte (without sending an (“@A”) and waiting for an ack. Then do a power cycle and read back the test byte from that first location. (Note that there is no ack returned from a read command).

I tried this test with a new card (Tesco cards are less than half the price of Maplin!) and it works at 2400, 4800 and 9600 without problems. Now its time to start adding some complexity.
 

moxhamj

New Member
The uDrive now can read FAT files. There is a new program you can flash the drive with, and 3 new commands (dir, read and write). Experiments are continuing but it seems quite easy to do. I've been posting on the 4dsystems forum with updates as they happen. The simplest thing this will mean is that a picaxe can store data in a file that you can read out on a PC as a standard .txt file, or .csv for excel etc. But it also opens up some other possibilities, eg a picaxe being able to read a .jpg and process the data. Or mass datalogging with code that doesn't fill up all the available picaxe code space. Stay tuned!
 

moxhamj

New Member
Code below in vb.net. Just need to translate it to picaxe basic...

Schematic for testing is at http://4d.websitetoolbox.com/post?id=3402498

Using a 2Gb sd card that cost only a few dollars. Mass storage for Help files, .jpgs, datalogging, wavetables etc. Very easy to transfer data to and from a PC using a little USB SD card reader/writer

Code:
' uDrive example code for vb.net
' test setup is a uDrive talking to a PC's serial port via a max232
' James Moxham May 2009 moxhamj at internode.on.net

Imports System.IO ' needed to run various calls
Imports Strings = Microsoft.VisualBasic ' so can use things like left( and right( for strings
Public Class Main
    Dim WithEvents SerialPort As New IO.Ports.SerialPort ' serial port declare
    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Integer) ' for sleep statements
    Public InPacket(0 To 2000) As Byte ' bug with serial.write strings like chr(255) won't go out
    Public OutPacket(0 To 50) As Byte ' usually only send out a few bytes though so could make this smaller
    Private Sub Initialise_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Initialise.Click
        ' initialise
        ' send a U at the selected baud rate baud to initialise
        Try
            SerialPort.PortName = "COM1"
            SerialPort.BaudRate = "38400" ' 38400
            SerialPort.Parity = IO.Ports.Parity.None ' no parity
            SerialPort.DataBits = 8 ' 8 bits
            SerialPort.StopBits = IO.Ports.StopBits.One ' one stop bit
            SerialPort.ReadTimeout = 1000 ' milliseconds so times out in 1 second if no response
            SerialPort.Open() ' open the port
            SerialPort.DiscardInBuffer() ' clear the input buffer
            OutPacket(0) = Strings.Asc("U") ' send a U and this sets the baud rate
            SerialPort.Write(OutPacket, 0, 1) ' send data in array outpacket start at 0 with 1 byte
            Sleep(100) ' wait for response
            SerialPort.Read(InPacket, 0, 1) ' read 1 byte back, should be 06 
            SerialPort.Close()
        Catch ex As Exception
            MsgBox("Error opening serial port - is another program using COM1? ")
            SerialPort.Close()
        End Try
        If InPacket(0) = 6 Then
            TextBox1.Text += "Initialised" + vbCrLf ' success
        Else
            TextBox1.Text += "Initialisation failed" + vbCrLf ' fail
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ' shutdown the program - make sure serial port is closed
        SerialPort.Close()
        End
    End Sub

    Private Sub ReadFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadFile.Click
        ' read back a file
        ' file name is in the text box in the format FILENAME.TXT where name is 1 to 8 chars, and extension is 3 chars
        Dim Filename As String
        Dim LengthFilename As Integer
        Dim i As Integer
        Dim j As Integer
        Dim Counter As Integer
        Dim BytesToRead As Integer
        Dim Filesize As Long ' size of the file to read back
        Dim PacketSize As Integer
        Dim Packets As Long ' number of packets
        Dim Remainder As Long ' remainder 
        Dim Readarray(50000) As Byte  ' array to read data into
        Dim Readcounter As Long ' counter for the readarray
        Readcounter = 0 ' reset the counter for the readarray
        PacketSize = 10 ' use 10 as convenient for picaxe
        Filename = TextBox2.Text ' name of file to read
        LengthFilename = Strings.Len(Filename) ' length of this filename
        OutPacket(0) = Strings.Asc("@") ' command to read
        OutPacket(1) = Strings.Asc("a")
        OutPacket(2) = PacketSize ' get in blocks of n bytes
        Counter = 3 ' increment counter 
        For i = 1 To LengthFilename ' send out filename
            OutPacket(Counter) = Strings.Asc(Strings.Mid(Filename, i, 1))
            Counter = Counter + 1
        Next
        OutPacket(Counter) = 0 ' null string to end
        Counter = Counter + 1 ' one more byte
        SerialPort.Open() ' open the serial port
        SerialPort.Write(OutPacket, 0, Counter) ' send data in array outpacket start at 0 
        Sleep(100) ' wait for response
        BytesToRead = SerialPort.BytesToRead ' how many bytes in the buffer? Should be 4
        SerialPort.Read(InPacket, 0, BytesToRead) ' read them in
        ' get the file size in bytes, msb first, 4 bytes
        Filesize = InPacket(0) * 16777216 + InPacket(1) * 65536 + InPacket(2) * 256 + InPacket(3)
        Filesize = Filesize + 1 ' number of bytes plus there is an <ack> on the end
        Counter = 0 ' reset the counter
        Packets = Filesize \ PacketSize ' integer division
        Remainder = Filesize Mod PacketSize ' and remainder left over
        For i = 0 To Packets - 1 ' get the n blocks of data
            OutPacket(0) = 6 ' ack
            SerialPort.Write(OutPacket, 0, 1) ' request a block
            Sleep(100) ' short delay
            SerialPort.Read(InPacket, 0, PacketSize) ' read back a block
            For j = 0 To PacketSize - 1 ' store in an array
                Readarray(Readcounter) = InPacket(j)
                Readcounter += 1 ' add 1 to readcounter
            Next
        Next
        ' now get the remainder
        OutPacket(0) = 6 ' ack
        SerialPort.Write(OutPacket, 0, 1) ' request a block
        Sleep(100) ' wait for it to come back
        SerialPort.Read(InPacket, 0, Remainder) ' read the remainder bytes, last should be 06
        For j = 0 To Remainder - 1 ' store in an array
            Readarray(Readcounter) = InPacket(j)
            Readcounter += 1 ' add 1 to readcounter
        Next
        ' print a message to say if it worked or not, ie is the last character =06
        If Readarray(Readcounter - 1) = 6 Then
            TextBox1.Text += vbCrLf + "Read success" + vbCrLf
        Else
            TextBox1.Text += vbCrLf + "Read fail" + vbCrLf
        End If
        ' if the actual file is 4 bytes long then there is now an <ack> at the end
        ' = 5 bytes and the last readcounter+=1 makes readcounter=6
        ' so trim off and make the readcounter correct
        Readcounter = Readcounter - 1 ' now will be = to 4
        Readarray(Readcounter) = 0 'delete the ack (assume it came through, it should have)
        SerialPort.Close() ' close the serial port
        ' vb.net test code - print the file in a text box
        For i = 0 To Readcounter - 1
            TextBox1.Text += Strings.Chr(Readarray(i))
        Next
    End Sub
    Private Sub Dir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dir.Click
        Dim DirBytes As Integer
        Dim i As Integer
        OutPacket(0) = Strings.Asc("@") ' command to read
        OutPacket(1) = Strings.Asc("d") ' directory
        OutPacket(2) = Strings.Asc("*") ' get all
        OutPacket(3) = 0 ' zero to end
        SerialPort.Open() ' open the serial port
        SerialPort.Write(OutPacket, 0, 4) ' send data in array outpacket start at 
        Sleep(2000) ' wait a while, big dumps take a long time (or just poll the input)
        DirBytes = SerialPort.BytesToRead ' number of bytes to read back
        SerialPort.Read(InPacket, 0, DirBytes)
        SerialPort.Close()
        ' display it
        TextBox1.Text += vbCrLf
        For i = 0 To DirBytes - 2 ' -1 and then 1 less for the ack at the end
            If InPacket(i) <> 10 Then ' 10 is the delimiter in this list
                TextBox1.Text += Strings.Chr(InPacket(i))
            Else
                ' replace with a new line
                TextBox1.Text += vbCrLf
            End If
        Next
    End Sub
    Private Sub Era_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Era.Click
        Dim Filename As String
        Dim LengthFilename As Integer
        Dim i As Integer
        Dim Counter As Integer
        Filename = TextBox3.Text
        LengthFilename = Strings.Len(Filename)
        OutPacket(0) = Strings.Asc("@")
        OutPacket(1) = Strings.Asc("e") ' erase 
        counter = 2
        For i = 1 To LengthFilename ' send out filename
            OutPacket(Counter) = Strings.Asc(Strings.Mid(Filename, i, 1))
            Counter = Counter + 1
        Next
        OutPacket(Counter) = 0 ' null string to terminate
        Counter += 1
        SerialPort.Open() ' open the serial port
        SerialPort.Write(OutPacket, 0, counter) ' send data in array outpacket start at 0 
        Sleep(100) ' wait for response
        SerialPort.Read(InPacket, 0, 1) ' acknowledge
        If InPacket(0) = 6 Then
            TextBox1.Text += "Erase success" + vbCrLf ' success
        Else
            TextBox1.Text += "Erase failed" + vbCrLf ' fail
        End If
        SerialPort.Close()
    End Sub
 
Last edited:

moxhamj

New Member
Code:
    Private Sub Writefile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Writefile.Click
        Dim Filestring As String ' convenient to store as a string for testing
        Dim Filearray(1000) As Byte  ' work with arrays for the file
        Dim FileLength As Long
        Dim PacketSize As Integer
        Dim i As Integer
        Dim j As Integer
        Dim Filename As String
        Dim Packets As Long
        Dim PacketRemainder As Integer
        Dim FileCounter As Long
        FileCounter = 0
        Filename = TextBox5.Text  ' name of file to save
        Filestring = TextBox4.Text ' this data would normally come from somewhere else
        PacketSize = 10
        FileLength = Strings.Len(Filestring)
        ' move the string into the array. (This string is just a convenience for testing)
        For i = 1 To FileLength
            Filearray(i - 1) = Strings.Asc(Strings.Mid(Filestring, i, 1)) ' convert to ascii value
        Next
        ' file is ready to output
        OutPacket(0) = Strings.Asc("@") ' command
        OutPacket(1) = Strings.Asc("t") ' write
        OutPacket(2) = PacketSize ' size of packets 0-50, new file (not append mode)
        SerialPort.Open() ' open the serial port
        SerialPort.Write(OutPacket, 0, 3) ' send data in array outpacket start at 0 
        For i = 1 To Strings.Len(Filename) ' send out the filename
            OutPacket(0) = Strings.Asc(Strings.Mid(Filename, i, 1))
            SerialPort.Write(OutPacket, 0, 1) ' send that byte
        Next
        OutPacket(0) = 0
        SerialPort.Write(OutPacket, 0, 1) ' send out a null string to terminate
        ' now send out the 4 bytes for the file length
        OutPacket(0) = FileLength \ 16777216 ' integer division
        SerialPort.Write(OutPacket, 0, 1)
        OutPacket(0) = FileLength \ 65536 ' integer division
        SerialPort.Write(OutPacket, 0, 1)
        OutPacket(0) = FileLength \ 256 ' integer division
        SerialPort.Write(OutPacket, 0, 1)
        OutPacket(0) = FileLength Mod 256 ' remainder
        SerialPort.Write(OutPacket, 0, 1)
        Sleep(100) ' wait for acknowledge
        SerialPort.Read(InPacket, 0, 1) ' should be 06
        If InPacket(0) <> 6 Then
            TextBox1.Text += "Error with first read"
        End If
        ' now send out the data in packetsize groups
        Packets = FileLength \ PacketSize ' integer division
        PacketRemainder = FileLength Mod PacketSize
        For i = 1 To Packets
            For j = 1 To PacketSize
                OutPacket(0) = Filearray(FileCounter)
                SerialPort.Write(OutPacket, 0, 1)
                FileCounter = FileCounter + 1
            Next
            Sleep(100)
            SerialPort.Read(InPacket, 0, 1)
            If InPacket(0) <> 6 Then
                TextBox1.Text += "Error with packet"
            End If
        Next
        ' now send out the remainder if it exists
        If PacketRemainder <> 0 Then
            For j = 1 To PacketRemainder
                OutPacket(0) = Filearray(FileCounter)
                SerialPort.Write(OutPacket, 0, 1)
                FileCounter = FileCounter + 1

            Next
            Sleep(100)
            SerialPort.Read(InPacket, 0, 1)
            If InPacket(0) <> 6 Then
                TextBox1.Text += "Write fail on last packet"
            End If
        End If
        SerialPort.Close()
    End Sub
End Class
 

moxhamj

New Member
Picaxe code below:

Code:
' udrive (4dsystems) file demonstration for micro SD card with FAT16 files for easy transfer to and from a PC
' code below uses 152 bytes (less if you want 'write' but not 'read' etc)
' pin 4 to the reset pin of the udrive (leg 1)
' ground to the ground of the udrive (leg 2)
' pin 2 to receive data on the udrive (leg 3)
' pin 3 to transmit data on the udrive (leg 4)
' 5V to 5V on the udrive (leg 5)

main:low 4			' 4 is reset pin
	high 2		' 2 transmits to the udrive (receive on pin 3) high is resting, low is data (T mode)
	pause 100		' startup delay for reset
	high 4		' 4 is reset pin - enable =high
	pause 1000		' short pause after resetting should be at least 500ms
	serout 2,T2400,("U") ' initialise
	serin 3,T2400,b0	' should be a 06 - if no reply then hangs
	' if b0<>6 then goto main ' if a reply but not a 06 then reset - probably not needed
	'gosub erasefile
	gosub writefile
	gosub readfile
	end
	
readfile: ' read file 10char.txt which has 10 characters
	serout 2,T2400,("@a",0,"10char.txt",0) ' packet size 0 ie send the entire file at once. Bigger files are possible in pieces
	serin 3,T2400,b0,b1,b2,b3 ' size of data file (we know it is 10 for this file)
	serout 2,T2400,(6) ' acknowledge got the file size
	serin 3,T2400,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 ' get 10 bytes, plus the last byte b10 should be 06
	' perhaps add error checking here if b10 does not equal 6
	' debug
	return
	
writefile: ' create a file with ABCDEFGHIJ in it. 10 bytes long	
	' this is a very simple demonstration. More advanced code can write files of indefinite length
	' and can append data to the end of an existing file. See the udrive documentation for more details.
	serout 2,T2400,("@t",0,"10char.txt",0,0,0,0,10)
	' @t is write, 0 is packetsize, filename (ends in zero), 4 filesize bytes
	serin 3,T2400,b10 ' should be a 6 to acknowledge
	serout 2,T2400,("ABCDEFGHIJ") ' send the data
	serin 3,T2400,b10 ' should be a 6
	' debug
	return
	
erasefile:	' erase a filename from the drive
	serout 2,T2400,("@e","10char.txt",0)
	serin 3,T2400,b10 ' should be a 6 to acknowledge
	' debug
	return
	
dirfile: ' this may be difficult on a small picaxe as the udrive dumps out all the file listing in one go
 

stocky

Senior Member
Thats looking promising Dr A!

I want a method to read a "parameters" files that I can email to a client and have them same to a card which they can then plug into their device and have the picaxe upload them to eeprom on reboot :)

I cant easily create a way to reprogram the picaxe in the field (end user) so that was my next idea - have the picaxe code somewhat generic to the job and then have setup the operation with a file - i guess there will be some way to read a file back , say line by line? Time to download the data sheet/manual and have a play!!

Might have to order me one of these little beauties!
 

moxhamj

New Member
I think this could be your solution. Write the code as generically as possible, with space for variables read from the udrive rather than from the picaxe code. Delay variables etc. You could even program things like which pin to change as something read from the udrive rather than from picaxe code. Then post the client out a micro sd when you want to update. The udrive holder is the expensive bit - the actual micro sd cards are getting very cheap now.

Reading the file back - just put it in a usb reader (worth $5) and it appears in the next available drive (drive F on my machine) as a standard file. Open it with notepad or word etc.
 

papaof2

Senior Member
Thanks for the udrive info and code. I'm working on a logging system for a friend and just spent his money for the udrive and shipping ;-)

John
 

CIPHERSYSTEMS

New Member
Udrive

Hi, may I ask for a better break down of this command

serout 2,T2400,("@t",0,"10char.txt",0,0,0,0,10)


I understand that "" are asci characters, but the numbers are transmitted as what? eg how does the strin look if we have a sniffer ont he line?

@t0x0010char.txt is this getting there?

eg if I was to write a program just to output it say in VB what would the whol stream look like?
 

westaust55

Moderator
you are on the right track with the characters.

In general,

the zeros (0) are null characters
the 10 is the ASCII code for a line feed. Usually drops down to a new line.

Specific to Dr_A's program you need to read the 4D systems udrive datasheet wrt the command to verify exactly what the individual values are required for/doing.
 
Last edited:
Top