Help understanding 24j600 operation

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
ChuckR
Posts: 34
Joined: 26 Feb 2014 21:30

Help understanding 24j600 operation

#1 Post by ChuckR » 17 Mar 2016 19:43

I am new to all of this especially the Ethernet terminology but I'm learning a lot, that said I have some specific questions about the serial Ethernet library. I have purchased a serial Ethernet 2 board and managed to get it working. Now I need to strip down the code. I need to send TCP data every few seconds, no need for me to respond to any requests. Here are the points I'm confused on...

There is a SPI_Ethernet_24j600_sendUDP but no SPI_Ethernet_24j600_sendTCP? Please explain.
I've read enough to understand they are different and why and that I am required to send TCP packets.

If I start using the SPI_Ethernet_24j600_putbyte and SPI_Ethernet_24j600_putstring commands how do I tell it I am at the end of my packet so I want it to send since there is no SPI_Ethernet_24j600_sendTCP?

When the 24j600 sends data does it reset its memory pointer to the first byte automatically so I can just start writing to it again?

My approach after the initialization routines is to have SPI_Ethernet_24j600_doPacket() in the main loop(is it required if I don't need to respond?)
then the required functions
sub function SPI_Ethernet_24j600_UserTCP(dim byref remoteHost as byte[4],
dim remotePort as word, dim localPort as word,
dim reqLength as word, dim byref flags as TEthJ600PktFlags) as word
result = 0 ' No reply
end sub

sub function SPI_Ethernet_24j600_UserUDP(dim byref remoteHost as byte[4],
dim remotePort as word, dim destPort as word,
dim reqLength as word, dim byref flags as TEthJ600PktFlags) as word
result = 0 ' No reply
end sub

Are these OK like this?

Then 1 more procedure I call when I want to send data

Sub Procedure Send_Data()
Dim Dyna as Char[34]
Dyna = "FF+0.0000000E+00,+0,+0.0000000E+00"
SPI_Ethernet_24j600_putString(@Dyna)
End Sub

Should this work or have I missed something? How does it know when to send?
Thanks for any feedback.

Post Reply

Return to “mikroBasic PRO for PIC32 General”