Hello
Today I was working on a 232 and saving data in eeprom, but when I tried to compile the code that you see below, I am reported a system error.
Filling in for the PIC's okay .........
#chip tiny44,1
'#chip 12F1840,1
#config osc = int
Dim Buffer As String
BufferSize = 5
Dim Buff1 As String
BufferSize = 5
Buff1 = Mid (Buffer, 1, 4)
do
wait 20 Ms
Loop
Thanks for any help, Marco
Last edit: Marcoos 2014-03-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
Today I was working on a 232 and saving data in eeprom, but when I tried to compile the code that you see below, I am reported a system error.
Filling in for the PIC's okay .........
Thanks for any help, Marco
Last edit: Marcoos 2014-03-19
That looks like a 'feature'. We need Hugh to pick it up and fix.
Try this as a work around. This is not tested but the concept should cut the string as you need.
Anobium
~~~~
#chip tiny44,1
#config osc = int
Dim Buffer As String
BufferSize = 5
Dim Buff1 As String
Mid_AVR(1,4)
do
wait 20 Ms
Loop
end
Function Mid_AVR( in startpnt as byte, in lenofstring as byte )
End Function
If you get the function working.... please post for others to use.
Thank you.
Hi
The compiler was ok now I watch the assembler and tomorrow the result
Thanks...........Marco
It worked with a 16f877a. There is no error handling so beware of calling the function. With incorrect values.
And, it would be much better as a sub routine as a function will always try to return a value.
Please change from a function to a sub.
~~~~~
#chip tiny44,1
#config osc = int
Dim Buffer As String
BufferSize = 5
Dim Buff1 As String
buffer = "123456"
' hard coded to extract from Buffer and place results in Buff1
Mid_AVR(1,4)
do
wait 20 Ms
Loop
end
Sub Mid_AVR( in startpnt as byte, in lenofstring as byte )
End Sub
Anobium
Last edit: Anobium 2014-03-19
Hello
I can confirm that run right, but remember that the same are for left and right
Marco
Excellent.
You can base a temporary solution for left$ and right$ on this approach until we get it fixed. I have added to the tracker.