Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Restrictions in full version?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
smoon

Bascom Member



Joined: 07 Apr 2009
Posts: 5

blank.gif
PostPosted: Tue Apr 07, 2009 6:26 pm    Post subject: Restrictions in full version? Reply with quote

Hi,

first of all I installed the demo version of Bascom AVR, but because of the restrictions I decided to get the full version. But I still cannot create files greater then 4KB... It comes the same error message... Error 118 (invalid length). Maybe there is a conflict with the further installed demo version?
Back to top
View user's profile
rileyesi

Bascom Member



Joined: 19 Dec 2006
Posts: 398

blank.gif
PostPosted: Tue Apr 07, 2009 6:57 pm    Post subject: Reply with quote

Hi,

Once upon a time, you had to remove the demo version before installing the full version. Not sure if that is still true or not. Might be worth a try.

Welcome, by the way.

Pete
Back to top
View user's profile
smoon

Bascom Member



Joined: 07 Apr 2009
Posts: 5

blank.gif
PostPosted: Tue Apr 07, 2009 7:06 pm    Post subject: Reply with quote

Now I removed all and installed only the full version but still the same problem
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2165

netherlands.gif
PostPosted: Tue Apr 07, 2009 8:13 pm    Post subject: Reply with quote

If you press Help -> About is there a serial number (don't post it here) or is there DEMO?
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
smoon

Bascom Member



Joined: 07 Apr 2009
Posts: 5

blank.gif
PostPosted: Tue Apr 07, 2009 8:24 pm    Post subject: Reply with quote

There is a serial no.
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2165

netherlands.gif
PostPosted: Tue Apr 07, 2009 8:36 pm    Post subject: Reply with quote

Ok, are you sure that the error occurs because of the 4k limitation?
Maybe you can post your code here and then i can try to compile it and see if there's an error and maybe why....

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
smoon

Bascom Member



Joined: 07 Apr 2009
Posts: 5

blank.gif
PostPosted: Tue Apr 07, 2009 8:45 pm    Post subject: Reply with quote

Yes I'm sure, but here is the code

Code:
Declare Sub Batteriespannung()
Declare Sub Motortest()
Declare Sub Lauflicht()
Declare Sub Showporta()
Declare Sub Showdigitalporta()
Declare Function Tastenabfrage() As Byte

$regfile = "m16def.dat"

Dim I As Integer
Dim N As Integer
Dim Ton As Integer

$crystal = 16000000
$baud = 9600

Config Adc = Single , Prescaler = Auto

Config Pina.7 = Input
Porta.7 = 1

Const Ref = 5 / 1023

Dim Taste As Byte
Dim Volt As Single

Config Pinc.6 = Output
Config Pinc.7 = Output
Config Pind.4 = Output

Config Pinb.0 = Output
Config Pinb.1 = Output
Config Pind.5 = Output
Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down
Pwm1a = 0
Pwm1b = 0
Tccr1b = Tccr1b Or &H02


I = 0
Sound Portd.7 , 400 , 450
Sound Portd.7 , 400 , 250
Sound Portd.7 , 400 , 450


Do
   Taste = Tastenabfrage()
   If Taste <> 0 Then

      Select Case Taste
         Case 1
            Call Batteriespannung
         Case 2
            Call Motortest
         Case 3
            Call Lauflicht
         Case 4
            Call Showporta
         Case 5
            Call Showdigitalporta
      End Select

      Sound Portd.7 , 400 , 500

   End If

   Waitms 100
Loop

End


Function Tastenabfrage() As Byte
   Local Ws As Word
   Tastenabfrage = 0
   Ton = 600
   Start Adc
   Ws = Getadc(7)
   If Ws < 500 Then
      Select Case Ws
         Case 400 To 410
            Tastenabfrage = 1
            Ton = 550
         Case 330 To 340
            Tastenabfrage = 2
            Ton = 500
         Case 260 To 270
            Tastenabfrage = 3
            Ton = 450
         Case 180 To 190
            Tastenabfrage = 4
            Ton = 400
         Case 100 To 110
            Tastenabfrage = 5
            Ton = 350
         Case Else
            Print "Tastenabfrage anpassen! ADC-Wert ws=" ; Ws
      End Select
      Sound Portd.7 , 400 , Ton
   End If
End Function


Sub Batteriespannung()
   Local W As Word
   Start Adc
   W = Getadc(6)
   Volt = W * Ref
   Volt = Volt * 5.2941
   Print "Die aktuelle Spannung beträgt: " ; Volt ; " Volt"
End Sub


Sub Motortest()
   Portc.6 = 1
   Portc.7 = 0
   Portd.4 = 1
   Portb.0 = 1
   Portb.1 = 0
   Portd.5 = 1
   I = 0
   Do
      Pwm1a = I
      Pwm1b = I
      Waitms 40
      I = I + 5
   Loop Until I > 1023

   Wait 1
   Do
      Pwm1a = I
      Pwm1b = I
      Waitms 40
      I = I - 5
   Loop Until I < 1
   Pwm1a = 0
   Pwm1b = 0
End Sub


Sub Lauflicht()
   Config Portc = Output
   Portd = 0
   For N = 1 To 10
      For I = 0 To 7
         Portc.i = 0
         Waitms 100
         Portc.i = 1
      Next I
   Next N
   Config Portc = Input
End Sub


Sub Showporta()
   Local Ws As Word
   Config Porta = Input
   For I = 0 To 5
      Porta.i = 1
   Next I
   Print
   Print "Ermittelte Messwerte an Port A:"
   For I = 0 To 7
      Start Adc
      Ws = Getadc(i)
      Volt = Ws * Ref
      Print "Pin " ; I ; " ADC-Wert= " ; Ws ; " bei 5V REF waeren das " ; Volt ; " Volt"
   Next I
End Sub


Sub Showdigitalporta()
   Local Zustand As String
   Config Porta = Input
   For I = 0 To 5
      Porta.i = 1
   Next I
   Print
   Print "Ermittelter I/O Zustand Port A:"
   For I = 0 To 5
      If Pina.i = 1 Then
         Zustand = "High"
      Else
         Zustand = "Low"
      End If
      Print "Pin " ; I ; " I/O Zustand= " ; Pina.i ; " " ; Zustand
   Next I
End Sub
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Tue Apr 07, 2009 8:48 pm    Post subject: Reply with quote

Hi,

The problem is your code. While dimensioning a local
variable you have forgotten to specify its length.


Wrong:
Code:
Local MyString As String


Correct:
Code:
Local MyString As String * 10



Best regards,

Luciano


EDIT: See your code "Local Zustand As String".
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2165

netherlands.gif
PostPosted: Tue Apr 07, 2009 8:53 pm    Post subject: Reply with quote

Your missing the string lengte here;
Code:

Sub Showdigitalporta()
   Local Zustand As String * 4     <====== add the *4 or other string lengte here
   Config Porta = Input
   For I = 0 To 5
 


If you click on the error that Bascom produce it will (most of the time) jumps to the line where the problem is.

Have fun.

Edit: Luciano was quicker then me Laughing

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
smoon

Bascom Member



Joined: 07 Apr 2009
Posts: 5

blank.gif
PostPosted: Tue Apr 07, 2009 9:01 pm    Post subject: Reply with quote

Yes your right. Now it works. Thx very much
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum