PDA

View Full Version : Some Bugs...



barzivb
20th October 2010, 11:31
Recently i bought Proton complier
I updated it to the last version
It's look great but i found some serious bugs :

1.When i write the command
"CWrite 8000,[1,0,4,0,7,0,"*",0,2,0,5,0,8,0,0,0,3,0,6,0,9,0,"#",0] "
in the memory it's write the initials numbers with "3F" thus when write 1 the value is 3F01, 2 = 3F02 etc...
if i write just 1 number it's ok, but if it's many numbers (like in the line up,the bug is occured

2. I must using addresses from memoy, so i have using with poke command
'Poke COUNTERT,ClickedTimer"
(COUNTERT and ClickedTimer are words variables)
if i write the address directly like "poke 7,ClickedTimer" so it's ok.
but if i write the address by variable "poke var1,var2 " it's done nothing
With the 2nd data, has no problem if it's variable

Thanks
Erez

Tim
20th October 2010, 15:48
1 Pic type
2 Some code we can test
3 Can you point me to where in the manual Poke is a command?

cgriffin
20th October 2010, 21:19
Tim must be busy; he's being brief!

On the cwrite, you do know that you must erase it prior to writing, right? The PIC type will determine how much must be erased.
In addition, because you are complaining of the preceding 3f, then I'm going to guess you are using a 16f, because if you read the manual (pg 160) it clearly states that $3fff is the max number available... I'm going to guess that if you tell it to write a byte that it is ONLY going to write the byte, and the top 6 bits are going to stay at $3f. Because 16f PIC's do not have 16 bit code space (they have 14 bit commands), you cannot write two bytes consecutively into memory, because it doesn't hold 2 bytes.

Peek and Poke are unsupported keywords...kind of an unnecessary hangover from the old days. Describe your goal, and somebody here will likely be able to help you with a better method.

Unregistered
27th October 2010, 19:52
1 Pic type
2 Some code we can test
3 Can you point me to where in the manual Poke is a command?

1. I operate it on 16f877.
2. poke 8,var of byte type - this is works
poke var1,var2 - this is not work at all
3. sorry, i don't understand your question

Tim
27th October 2010, 21:20
Were in the manual is the Poke command that you are talking about?

Post the section from the manual so I can see the syntax

C_Moore
28th October 2010, 10:28
Actualy Tim Peek and Poke are valid commands. They are just not documented.

wastrix
28th October 2010, 10:51
The reason why a command may not be documented is usually because it is deprecated, is "advanced" or "dangerous" or in beta stage - possibly they do not work in all cases or they are only kept to maintain semi-compatibility with old programs and other languages like for the Basic Stamp, etc.

In general, if a command/directive/etc. is not documented, presumably it would have been removed or neglected to be put in by Les for a reason and so it is not good practice to use it in new programs.

C_Moore
28th October 2010, 11:44
point being it is still a valid command. If it is not recommended for use then it should be removed.

Tim
28th October 2010, 14:09
The point is it is a non supported command. I was left in for backward compatibility, there are loads of commands not used but the name is reserved. As I said in my post.

"Post the section from the manual so I can see the syntax"

barzivb
30th October 2010, 14:54
__________________________________________________ __________________
Why take off these important commands (peek & poke) insteed just fix the bugs ?
This commads exist properly all the other pic's languages, so no reson it's not in Proton....
i used by them to choose the right outputs or inputs by a smart multi-data table from memory, so the program determine by the data which port and what is the data.
In this way the program is so small, smart fast and effective

Thank

Erez
__________________________________________________ __________________


The point is it is a non supported command. I was left in for backward compatibility, there are loads of commands not used but the name is reserved. As I said in my post.

"Post the section from the manual so I can see the syntax"

Tim
30th October 2010, 18:06
What BUGS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!

You cannot even show the syntax!!!!!!!!!!!!!!!!!!!!!! How can you say its a BUG! when words may not be supported by the command!

There are other commands that do exactly the same task like Cread etc.

barzivb
30th October 2010, 19:08
Dear Tim, i'm talking about POKE, the syntext has written in the begging of this issue already (i quote it for you again)
I used it at 16f877

if do you want more explanations please tell me :
"
2. I must using addresses from memoy, so i have using with poke command
'Poke COUNTERT,ClickedTimer"
(COUNTERT and ClickedTimer are words variables but with byte is the same)
if i write the address directly like "poke 7,ClickedTimer" so it's ok.
but if i write the address by variable "poke var1,var2 " it's done nothing
With the 2nd data, has no problem if it's variable
"
Thanks

Erez


What BUGS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!

You cannot even show the syntax!!!!!!!!!!!!!!!!!!!!!! How can you say its a BUG! when words may not be supported by the command!

There are other commands that do exactly the same task like Cread etc.

SimonJA
30th October 2010, 19:26
barzivb why don't you describe what it is that you would like to do, I'm sure you will get some help.

Screaming bug with the first problem you encounter when you have just started using Proton is not the way to go.

pverburg
30th October 2010, 19:28
you missing the point Tim is trying to make.
Its not in the manual no two basic's are the same just that it works like that in one version don't mean it works in proton!!!!!
at the moment its a non documented non supported command so you can't say bug !
Bill Gates has many of these for debugging and programmers to test they will never be released to the public.
Paul V.

Tim
30th October 2010, 20:20
All I asked was for you to cut and paste from the manual the syntax for the Poke command! Its a simple question. Show me the official syntax................

bill9399
30th October 2010, 22:57
;)
All I asked was for you to cut and paste from the manual the syntax for the Poke command! Its a simple question. Show me the official syntax................

Ask and ye shall receive, seek and ye shall find.;)


Version 3.4 manual


Page 308 :eek:



Peek
Syntax
Variable = Peek Address
Overview
Retrieve the value of a register and place into a variable
Operators
Variable is a user defined variable.
Address can be a constant or a variable, pointing to the address of a register.
Example 1
A = Peek 15
Variable A will contain the value of Register 15. If the device is a 16F84, for example, this regis-ter is one of the 68 general-purpose registers (RAM).
Example 2
B =
15 A = Peek B
Same function as example 1
Note
Use of the Peek command is not recommended. A more efficient way of retrieving the value from a register is by accessing the register directly: -
Variable = Register
See also : Poke.
Page 312 :eek:



Poke
Syntax
Poke Address, Variable
Overview
Assign a value to a register.
Operators
Address can be a constant or a variable, pointing to the address of a register.
Variable can be a constant or a variable.
Example
A = 15
Poke 12, A ' Register 12 will be assigned the value 15.
Poke A, 0 ' Register 15 will be assigned the value 0
Note
Use of the Poke command is not recommended. A more efficient way of assigning a value to a register is by accessing the register directly: -
Register = Value
See also : Peek.
Note the parts which state 'Use of P*** command is not recommended'

cgriffin
31st October 2010, 00:49
Bill, I'll bet he's not using version 3.4...

Erez,
As Tim has said more than once, there is probably a better way to do what you need. Here is one example.

Dim MyTempArray[10] as byte
...your code here...
'use this instead of poke:
MyTempArray[COUNTER] = ClickedTimer 'same as Poke COUNTERT,ClickedTimer
'use this instead of peek:
TempVariable = MyTempArray[COUNTER] 'same as TempVariable = peek COUNTERT

bill9399
31st October 2010, 08:31
Bill, I'll bet he's not using version 3.4...

Erez,
As Tim has said more than once, there is probably a better way to do what you need. Here is one example.


No doubt, but Tim was labouring the point that Peek and Poke were not in the manual. May be an old version of the manual, but the commands are most assuredly described there.
Also, if you read the extract from that particular version of the manual (PDF file), alternatives to using Peek and Poke are described.
If the latest version of the compiler no longer supports these commands, shouldn't there be an entry in the latest manual pointing this out, or at least some information to that effect added to the 'What's new' text?

Tim
31st October 2010, 12:40
I do not have Ver 3.4 of the manual so I could see the syntax and that was my point.

Now its been posted I cannot see the syntax and as I suspected its all working correctly and the error is in his code

Variable = Peek Address
Overview
Retrieve the value of a register and place into a variable
Operators
Variable is a user defined variable.
Address can be a constant or a variable, pointing to the address of a register.

Peek Poke was designed to work with single regs not words or dwords

barzivb
31st October 2010, 23:42
Well my friends, i'm working with the latest update compiler vertion 3.2.5.5, and i know proton some years and like it very much.

So, dear Tim, as i understand you, peek and poke supposed to work properly with variables of byte apart.

First of all, the variables kinds doesn't indicate in the manual
"
<TABLE border=0 cellPadding=0 width="100%" bgColor=#000000><TBODY><TR><TD width="86%">POKE</TD><TD bgColor=#ffffff vAlign=center width=50 noWrap align=middle>12</TD><TD bgColor=#ffffff vAlign=center width=50 noWrap align=middle>14</TD><TD bgColor=#ffffff width=50 noWrap align=middle>16</TD></TR></TBODY></TABLE>
Syntax

POKE Address , Variable

Overview

Assign a value to a register.

Operators

Address - a constant or a variable, pointing to the address of a register.
Variable - a constant or a variable.
Example

A = 15
POKE 12 , A ' Register 12 will be assigned the value 15.
POKE A , 0 ' Register 15 will be assigned the value 0

Notes

Use of the Poke command is not recommended. A more efficient way of assigning a value to a register is by accessing the register directly

REGISTER = VALUE

See Also

PEEK (mk:@MSITStore:C:\Program%20Files\ProtonIDE\Proton IDE.chm::/hs1689.htm)
"

secondly, even with byte it didn't work, i test it.
thirdly, if the programmer insert wrong variable, so the compiler must reject it into the proccess.

Isn't it ?

Thanks

Erez


I do not have Ver 3.4 of the manual so I could see the syntax and that was my point.

Now its been posted I cannot see the syntax and as I suspected its all working correctly and the error is in his code

Variable = Peek Address
Overview
Retrieve the value of a register and place into a variable
Operators
Variable is a user defined variable.
Address can be a constant or a variable, pointing to the address of a register.

Peek Poke was designed to work with single regs not words or dwords

Les
1st November 2010, 09:23
Version 3.2.5.5 is not the latest version, and hasn't been for some time now.

Peek and Poke are officially removed from the language and removed from the PDF manual, as they were a pointless leftover from previous versions using simpler microcontroller devices. They continue to be an unofficially part of the language and will eventually be removed altogether, as will Data, Read, and Restore.

I will not be correcting a "possible" bug in a command that is no longer supported, I have more important issues to deal with within the compiler's environment.

For the record, Poke and Peek worked on variables, not code space.

Sean_Goddard
11th November 2010, 21:16
TIM, NOoooooooooooooooooooooo!!!!

For the following reason (apart from the fact that I use these command a LOT).

Please see my DDS post!

Unregistered
12th November 2010, 11:24
Peek and Poke Ah remember them well..

Page 295 of the manual (V1.2)!!! Yes I was a VERY early adopter of the IDE, in fact I'd happily pay even for updates because I consider this software is THAT GOOD!!.

I tried for YEARS to get the hang of programming PIC's then I found Proton Basic. I bought it, and my first project worked FIRST TIME!

IMHO Tim is a GENIUS for giving us this awesome piece of work which does exactly what it says on the tin and, as far as I can see, with so few bugs (yes there will always be a few) but Tim get's right on any genuine ones and sorts them out ASAP. How few companies or individuals behave like that these days?

Tim
12th November 2010, 11:28
Important

I (Tim) am just a user LES is the compiler writer

Sean_Goddard
12th November 2010, 11:59
Actually that was MY post, my browser logged me out for some reason.

Sorry Les. Thanks Tim (I still value your input though);)