Click here to Skip to main content
16,021,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i am reading hex file and writing it to the board using dln4s.i use spi. write() function to write data using vb.here i am using page write method.which means each page in eeprom can have 128 bytes of data.using the counter i am counting bytes.the thing is spi requires a minimal gap of 15ms after writing 128 bytes of data to the page.
how to insert the delay after 128 bytes for spi.write function.

What I have tried:

spi.write()
i tried using wait(1)
and threading.sleep(1).
Posted
Updated 5-Dec-16 13:22pm
Comments
[no name] 19-Oct-16 15:18pm    
VB6 used Sleep
Member 12659926 20-Oct-16 1:20am    
i need to insert delay between spi.write().means i will send 128 bytes of dataat the first,then i want to insert a delay of 15ms before sending next 128 bytes.
i am doing like this
Dim Buffer(256) as byte
if(cnt=128)
spi.write(buffer)
EndIf
after every 128 bytes i want to delay the writing by 15ms
how to acheive it
[no name] 20-Oct-16 6:02am    
I don't see Sleep anywhere in your unformatted code.
Member 12659926 20-Oct-16 6:06am    
Dim Buffer(256) as byte
if(cnt=128)
spi.write(buffer)
System.Threading.Thread.Sleep(1)
EndIf
i have made like this,in this it is making the program execution delay,but i want to stop the spi writing for 15 ms,after 15 ms delay it should write data.
please provide me the solution to delay spi communication asap
thanks in advance
[no name] 20-Oct-16 8:56am    
First of all I work to my own schedule not yours.
Secondly "System.Threading.Thread.Sleep(1)" won't even compile in VB6

1 solution

There are a whole bunch of options on this post vb6 - Need to create a 30 second delay in Visual Basic[^]
You need to make sure you pick up VB6 solutions OR do the sensible thing and start using .NET instead (there are free versions, there are no free (legal) VB6 versions)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900