Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATXMEGA256A3U PORTB problem

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

Bascom Member



Joined: 31 Jan 2008
Posts: 25

czechrepublic.gif
PostPosted: Fri Nov 03, 2017 1:27 pm    Post subject: ATXMEGA256A3U PORTB problem Reply with quote

I have tried to transfer functional code from ATXMEGA128A3U to ATXMEGA256A3U. Simple thing for a few minutes. But I stay for a few hours because of PORTB strange behaviour - higher part of PORTB does not work (not periodically changing in code example, only 4 lower bits) in ATXMEGA256A3U as in ATXMEGA128A3U! I have simplified it to code example, there are two possibilities I have tried but it does not work. Can anybody help me?

[code]
$regfile = "xM256a3uDEF.DAT"

$hwstack = 64 '64
$swstack = 64 '64
$framesize = 64

$lib "xmega.lib" : $external _xmegafix_clear : $external _xmegafix_rol_r1014
'---------------------------------------------------------------
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 Portb = Output
Do
Portb = 0
Waitms 500
Portb = 255
Waitms 500
Loop


Config Vport0 = B
Ddr0 = &B1111_1111

Do
Port0 = 0
Waitms 500
Port0 = 255
Waitms 500
Loop
[/code]

[b][color=red](BASCOM-AVR version : 2.0.8.0 , Latest : 2.0.7.8 )[/b][/color]
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1136

poland.gif
PostPosted: Fri Nov 03, 2017 2:25 pm    Post subject: Reply with quote

I saw this a week ago Wink
Gues what?

Please insert this line near top of the code Wink
Code:
Disable Jtag


Hahaha, jest it should be the JTAG Wink
You can also disable it by programming the FuseBits

Have a nice day
Back to top
View user's profile Visit poster's website
unzeitig

Bascom Member



Joined: 31 Jan 2008
Posts: 25

czechrepublic.gif
PostPosted: Fri Nov 03, 2017 2:48 pm    Post subject: Reply with quote

Sure, I completely forgot it, I have used it two years ago in another project with SW JTAG control!
Thank you for your help
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