B4R Question bulk - works fine

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
Hi,

just got a DUE here and try to shovel bulk. It works fine, but ist it the flash or the sram, I use?

B4X:
Sub Process_Globals
        Private random As RandomAccessFile
end sub

Private Sub AppStart
    Dim bulk(5000) As Byte             'init
    random.Initialize(bulk,False)
    For i = 0 To 999                   ' fill
        random.WriteByte(i Mod 255,i )
    Next
    
    Delay(1000)

    Dim bulk2(100) As Byte = random.ReadBytes2(100,0)

    For i = 0 To 99
        log(bulk2(i))
    Next
end sub


(shell be usefull for the Astream_NewData buffer problem)

wish you a healthy start from berlin
 
Last edited:

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
oh yes. It means, it is easy, to transfer bulk data fast with astream. I send 60Byte Blocks to aStream_NewData with a header, that defines the position in the reserved random memory. Works secure within the correct delay (about 20ms) at sender. aStream_New_data puts it there and it is availiable from any other sub in the code.

Maybe, there is an other method, but for me I got best results up to now. Basically, serial should be much faster, but it seems to depend on interrupt, that is not availiabel in fast execution of other routines, as well as I cannot use listeners for pins, when plotting.

I guess, its inside the sRam, that means, I got 96 KB space inside the due. Good enough for my Plotter:)

... no, thats wrong. I dimensioned bulk to 200.000B - must be flash (500.000 availiable)...
 
Last edited:
Upvote 0
Top