unzeitig
Joined: 31 Jan 2008 Posts: 25
|
Posted: Mon Jul 29, 2019 4:00 pm Post subject: MODBUS master on XMEGA |
|
|
Can somebody explain me why it does not work - it prints ABC only and stay running on Print #1 , Makemodbus(2 , 3 , B , 8); row.
When I try it with MEGA128 - it works properly.
[code]
$regfile = "xm128a3udef.dat"
$hwstack = 64
$swstack = 40
$framesize = 40
$lib "xmega.lib" : $external _xmegafix_clear : $external _xmegafix_rol_r1014
$lib "modbus.lbx"
'---------------------------------------------------------------
Const Crystalfrekq = 32000000
$crystal = Crystalfrekq
Config Osc = Disabled , 32mhzosc = Enabled , 32khzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1 'CPU Clock = 32MHz
Bitwait Osc_status.1 , Set 'Check if 32MHz Oscillator is ready
Bitwait Osc_status.2 , Set 'Check if internal 32.768 KHz Oscillator is ready
Osc_dfllctrl.0 = 0
Dfllrc32m_ctrl.0 = 1 'enable
Config Com1 = 9600 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8
Open "COM1:" For Binary As #1
'dimension some variables
Dim B As Byte
B = &H26
Do
Print #1 , "ABC"
Print #1 , Makemodbus(2 , 3 , B , 8);
Loop
End
[/code]
[b][color=red](BASCOM-AVR version : 2.0.8.1 )[/b][/color] |
|