Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

xmega32e5 and PCF8574

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

Bascom Member



Joined: 02 Jan 2017
Posts: 112

poland.gif
PostPosted: Wed May 11, 2022 1:46 pm    Post subject: xmega32e5 and PCF8574 Reply with quote

Hi,

wasting no time according to learn xmega I try to use lcd 16x2 with i2c converter PCF8574. As for atmega there was not problem here with atxmega I suppose that my code is not valid or I can't simply use bl_Lcd_i2c.lib library. During compilation get errors

Code:
Error : 5     Line :  -332   No more space for BIT [TWI_START]  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 5     Line :  -332   No more space for BIT [TWI_START]  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 5     Line :  -332   No more space for BIT [TWI_START]  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 5     Line :  -332   No more space for BIT [TWI_START]  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 320   Line :   209    [syntax error, token = '{']  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 320   Line :   211    [syntax error, token = '{']  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 320   Line :   240    [syntax error, token = '{']  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
Error : 320   Line :   246    [syntax error, token = '{']  , in File : C:\MCS\BASCAVR2082\LIB\XMEGA.LIB
 


The code:
Code:

$regfile = "xm32e5def.dat"
$crystal = 32000000 '32MHz
$hwstack = 80
$swstack = 60
$framesize = 60

$lib "bl_Lcd_i2c.lib"

Config Osc = Enabled , 32mhzosc = Enabled 'We use internal 32MHz
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1 'Internal 32MHz, no prescaler

Config Twic=100000
Config Scl = Portc.1
Config Sda = Portc.0

Const Pcf_d4 = 4
Const Pcf_d5 = 5
Const Pcf_d6 = 6
Const Pcf_d7 = 7
Const Pcf_rs = 0
Const Pcf_rw = 1
Const Pcf_e1 = 2

Dim _lcd_e As Byte
Dim Backlight As Byte

Backlight_on Alias &H08
Backlight_off Alias &H00
Backlight = Backlight_on

_lcd_e = 128

Const Pcf8574_lcd = &H4E                                     'Defines the address of the I/O expander for LCD

Locate 1 , 1
Lcd "Whatever"

End
 


Best regards,
Martin

(BASCOM-AVR version : 2.0.8.5 )
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Thu May 12, 2022 8:31 am    Post subject: Reply with quote

You can hit F1 in Bascom and write "Config TWI" in the Index Wink
There you can read: "You MUST dimension a variable named TWI_START as a byte."
Back to top
View user's profile Visit poster's website
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 112

poland.gif
PostPosted: Thu May 12, 2022 9:17 am    Post subject: Reply with quote

Embarassed
have no idea how I omitted it..
Thanks

Regards,
Martin
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