Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 29, 2024, 12:40:22 12:40


Login with username, password and session length


Pages: [1]
Print
Author Topic: Proton: LookdownL + Array  (Read 6295 times)
0 Members and 1 Guest are viewing this topic.
Basicpic
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 9
-Receive: 43

Welcome! www.picbasic.ru


WWW
« on: February 16, 2011, 12:06:17 00:06 »

I have a one question.
I have a code:
Code:
DIM ADC AS WORD
DIM G AS BYTE
DIM config[16] AS WORD
Displaying:
G = LOOKDOWNL ADC, <= [ 0, config[1],config[2],config[3],config[4],config[5],config[6],config[7],config[8],config[9],config[10],config[11],config[12],config[13],config[14],config[15],config[16] ]
GOTO Displaying

Why the compiler (3.5.0.6/3.5.1.2) return error - ERROR[Line 210]: Comma missing, or command terminated incorrectly!

With PBP i use this:

Code:
ADC var WORD
 G var BYTE
config[16] var WORD
Displaying:
G = LOOKDOWN2 ADC, <= [ 0, config[1],config[2],config[3],config[4],config[5],config[6],config[7],config[8],config[9],config[10],config[11],config[12],config[13],config[14],config[15],config[16] ]
GOTO Displaying

and not any errors. Why? Proton help have no any info about arrays with LookdownL. Help me, please
Logged

pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #1 on: February 16, 2011, 09:52:35 21:52 »

maybe your syntex is wrong Config is a protected word in Proton, It in the Manual.

Also why are people saying Help don't work. I have seen this asked in Crownhill forum too.
« Last Edit: February 16, 2011, 10:00:44 22:00 by pickit2 » Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
Basicpic
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 9
-Receive: 43

Welcome! www.picbasic.ru


WWW
« Reply #2 on: February 17, 2011, 04:10:51 04:10 »

I know about F1. But my compiler help (.pdf) have no any information about lookdownl + arrays with constant index.

Quote

Syntax
Variable = LookDownL Index, {Operator} [ Value {, Value…etc } ]
Overview
A comparison is made between index and value; if the result is true, 0 is written into variable. If
that comparison was false, another comparison is made between value and value1; if the result
is true, 1 is written into variable. This process continues until a true is yielded, at which time the
index is written into variable, or until all entries are exhausted, in which case variable is unaffected.
Operators
Variable is a user define variable that holds the result of the search.
Index is the variable/constant being sought.
Value(s) can be a mixture of 16-bit constants, string constants and variables. Expressions may
not be used in the Value list, although they may be used as the index value. A maximum of 85
values may be placed between the square brackets, 256 if using an 18F device.
Operator is an optional comparison operator and may be one of the following: -
= equal
<> not equal
> greater than
< less than
>= greater than or equal to
<= less than or equal to

Logged

Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 747

Thank You
-Given: 169
-Receive: 1288



« Reply #3 on: February 18, 2011, 07:45:57 19:45 »

Why you didn't just use this syntax :

G = config[ADC]

it is simple and equivalent to your code

you error is because the symbol  "<="
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #4 on: March 02, 2011, 03:42:22 03:42 »


Hi  i have problems whith proton plus in this code:

Device 12F510
Dim x As Byte   
x = adin 0    "error no support 12 bit"  but this contain some a/d internals

too problems lookup command   , other alternative CDATA dont support
up 100 > ...   [1,2,3,4,5...... ,_
                     150,151...]
with much values dont work fine in this prosessor

some idea?
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #5 on: March 02, 2011, 11:56:20 11:56 »

maybe 12F510 has A/D internals, But proton don't support that device.
see page 44 of manual.
« Last Edit: March 02, 2011, 11:59:00 11:59 by pickit2 » Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
FranzW
Active Member
***
Offline Offline

Posts: 182

Thank You
-Given: 589
-Receive: 81



« Reply #6 on: January 31, 2012, 04:16:17 16:16 »

Hello,
Perhaps I should have started a new thread, but I don't know how to do it.

I need to count fast incoming encoder pulses by means of interrupts on PORTB.7. Does somebody know what must I do in order to place my interrupt routine at ORG 4, the interrupt vector address? If I use ORG 04 in the program below, Proton issues the error message: “Overwriting previous address contents (0004)”
Part of the program can be seen below.

Device = 16F877A
Declare Xtal = 4
All_Digital = true
Dim Pulses As Word 'To store RB7 interrupts
TRISB = %11111001

' OTHER VARIABLES, TRIS, etc. WILL BE DECLARED HERE.

'Making place to save the required registers during the interrupt.
'Since I didn’t find anything about this in the Proton manual,
'I created room to save the registers, as stated in the PBP V 2.46 manual.
Asm
     W0 equ 0x0020 'bank 0 place For W
     S0 equ 0x0021 'bank 0 place for STATUS
     P0 equ 0x0022 'bank 0 place for PCLATH
     W1 equ 0x00A0 'bank 1 place for W
     W2 equ 0x0120 'bank 2 place For W
     W3 equ 0x01A0 'bank 3 place For W       
EndAsm   
         

GoTo Program 'Jump over the interrupt routine
'***********************************************
'*************Interrupt routine

Asm
   'Save registers
   Movwf W0
   Swapf STATUS, w
   Clrf STATUS
   Movwf S0
   Movf PCLATH, w
   Movwf P0
   
   'The interrupt code will be placed here.
   
   
   'Restore registers
   Movf P0, w
   Movwf PCLATH
   Swapf S0, w
   Movwf STATUS
   Swapf W0, f
   Swapf W0, w
   Retfie
EndAsm
'*****************************************
Program:
'Program code is placed here.

Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #7 on: January 31, 2012, 10:40:30 22:40 »

To start a new topic select "New Topic" in section you want to post in.
you will see new topic button to the right

Sonsivri > Electronics > Pic Basic Languages This Topic
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC