Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

XMEGA PLL Clock in 2.0.8.0 - Compile error?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 548

PostPosted: Mon Feb 27, 2017 4:18 am    Post subject: XMEGA PLL Clock in 2.0.8.0 - Compile error? Reply with quote

This problem is a little difficult to explain.

This code snippet has been used for some time in Bascom versions 2.0.7.8, 2.0.7.9 and 2.0.8.0. The complete program compiles and works properly in all versions when $CRYSTAL = 32MHz.

Code:
$regfile = "xm192a3udef.dat"
$hwstack = 1600
$swstack = 1600
$framesize = 1600

Osc_dfllctrl.0 = 1
Dfllrc32m_ctrl.0 = 1                                        'enable CALIBRATION

Const Clk_spd = 32

#if Clk_spd = 32
    $crystal = 32000000
    Config Osc = Disabled , 32mhzosc = Enabled                  ' 32 MHz enabled
    Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1  'use 32 MHz
#endif

#if Clk_spd = 24
     $crystal = 24000000
     Config Osc = Disabled , 32mhzosc = Enabled             'internal 2 MHz and 32 MHz enabled
     Osc_pllctrl = &B10_0_00011                            
                   '      ^    'Multiplication factor
                   '00 2mhZ
                   '10 PLL Source = 32MHz internal Oscillator (divided by 4 in hardware)
     Set Osc_ctrl.4                                         ' PLL enable
     Bitwait Osc_status.4 , Set                             'Check if PLL is ready
     Config Sysclock = Pll , Prescalea = 1 , Prescalebc = 1_1       ' configure the systemclock ---> use PLL
     Waitms 2

#endif

#if Clk_spd = 40
     $crystal = 40000000
     Config Osc = Disabled , 32mhzosc = Enabled             'internal 2 MHz and 32 MHz enabled
     Osc_pllctrl = &B10_0_00101                            
                   '      ^    'Multiplication factor
                   '00 2mhZ
                   '10 PLL Source = 32MHz internal Oscillator (divided by 4 in hardware)
     Set Osc_ctrl.4                                         ' PLL enable
     Bitwait Osc_status.4 , Set                             'Check if PLL is ready
     Config Sysclock = Pll , Prescalea = 1 , Prescalebc = 1_1       ' configure the systemclock ---> use PLL
     Waitms 2

#endif

#if Clk_spd = 48
     $crystal = 48000000
     Config Osc = Disabled , 32mhzosc = Enabled             'internal 2 MHz and 32 MHz enabled
     Osc_pllctrl = &B10_0_00110                             ' 8MHz clock Source and Multiplication factor = 6 = 48
                   '      ^    'Multiplication factor
                   '00 2mhZ
                   '10 PLL Source = 32MHz internal Oscillator (divided by 4 in hardware)
     Set Osc_ctrl.4                                         ' PLL enable
     Bitwait Osc_status.4 , Set                             'Check if PLL is ready
     Config Sysclock = Pll , Prescalea = 1 , Prescalebc = 1_1       ' configure the systemclock ---> use PLL
     Waitms 2

#endif
 


When the PLL is used for other clock speeds, it compiles and works properly in Bascom versions 2.0.7.8 and 2.0.7.9.

However, in version 2.0.8.0, these two errors are generated when the PLL is used:
Quote:
Error : 222 Line : 7307 Illegal character [expected (, got '' [_PRDWORD]] , in File : C:\Users\elm\Desktop\Testing\Test.bas
Error : 222 Line : -68717 Illegal character [expected (, got '' [_PRDWORD]] , in File : C:\PROGRAM FILES (X86)\MCS ELECTRONICS\BASCOM-AVR\LIB\MCS.LBX

I don't really know where to look in the code to find the statement(s) that may be causing these errors.

Any help would be appreciated.

E

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Mon Feb 27, 2017 5:46 am    Post subject: Reply with quote

ih,
compile no error in latest bascom version (downloaded yesterday) !
with all xtal settings
result from
Code:
Const Clk_spd = 48

Quote:
Compiler version :2.0.8.0
Compiler build :2.0.8.0.001
IDE version :2.0.8.0.006
Windows OS :Windows 10 Pro


Report : Xmega_xtal_error
Date : 02-27-2017
Time : 05:30:08

Compiler : BASCOM-AVR LIBRARY V 2.0.8.0
Processor : XM192A3U
SRAM : 4000 hex
EEPROM : 800 hex
ROMSIZE : 31FFE hex

ROMIMAGE : 342 hex -> Will fit into ROM
ROMIMAGE : 834 dec
FLASH USED : 0 %
XTAL : 48000000 Hz

Stack start : 5FFF hex
Stack size : 640 hex
S-Stacksize : 640 hex
S-Stackstart : 59C0 hex
Framesize : 640 hex
Framestart : 4D40 hex
Space left : 11542 dec

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Mon Feb 27, 2017 10:01 am    Post subject: Reply with quote

_PRDWORD was used in older versions.
So i guess you mixed up the libs. You should never mix libs/compilers/IDE.

_________________
Mark
Back to top
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 548

PostPosted: Mon Feb 27, 2017 3:16 pm    Post subject: Reply with quote

Thank-you Mark and Kim.

Downloaded and installed the version 2.0.8.0 now available for download and the issue is RESOLVED! Thank-you.

Previous 2.0.8.0 version:
Quote:
Splash screen: Copyright 1995-2016

Compiler version :2.0.8.0
Compiler build :2.0.8.0.001
IDE version :2.0.8.0.004


Current 2.0.8.0 version:
Quote:
Splash screen: Copyright as 1995-2017

Compiler version :2.0.8.0
Compiler build :2.0.8.0.001
IDE version :2.0.8.0.006


Hope this helps.

E
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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