Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Configuring Portmux for TCB0/1

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX
View previous topic :: View next topic  
Author Message
LEODEO

Bascom Member



Joined: 10 May 2005
Posts: 2
Location: Austria

PostPosted: Thu Sep 11, 2025 1:45 pm    Post subject: Configuring Portmux for TCB0/1 Reply with quote

Good day,

I have been trying to configure Portmux to use the WOīs of TCB0 and TCB1 on a MEGAX4809, i am running BASCOM AVR 2.0.8.7. Before going into writing into the registers by myself, i wanted to ask what i am doing wrong :

Looking at documentation and datasheet this would be sufficient information IMHO :

Code:

Config PORT_MUX = OVERWRITE , TCB0 = ALT_PF4
Config PORT_MUX = OVERWRITE , TCB1 = ALT_PF5
 


But this is raising a compiler error 101 (that error number makes me feel very stupid btw. Laughing ) :

[Canīt find HW-Register [PORTMUX_TCAROUTEB] , in File blah

But what i wanted to do is to set PORTMUX_TCBROUTEA, bit 0 and 1 to point TCB0 WO to PF4 and TCB1 WO to PF5. I donīt know how and where i brought TCAROUTEB into the Game.

Any suggestion ?
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1167

poland.gif
PostPosted: Thu Sep 11, 2025 2:29 pm    Post subject: Reply with quote

I think there is a typo in the DAT file.



I think in the lines:
3386 there is PORTMUX_TCAROUTEB but should be PORTMUX_TCBROUTEA
3389 there is PORTMUX_TCAROUTEB but should be PORTMUX_TCBROUTEA

DAT files you can watch and edit in any text editor or even Bascom if you have in Options->Environment->Editor->No reformat files "DAT"

_________________
Check B-Flash -my MCS bootloader app for Android
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6245
Location: Holland

blank.gif
PostPosted: Thu Sep 11, 2025 2:33 pm    Post subject: Reply with quote

It seems there is an error in the DAT file for the [PORTMUX]


OPTION19=TCB0
OPTION19VALUE=[DEFAULT_PA2,ALT_PF4]
OPTION19DATA=[PORTMUX_TCAROUTEB,5,xxxx1110,0,1]


change :

OPTION19=TCB0
OPTION19VALUE=[DEFAULT_PA2,ALT_PF4]
OPTION19DATA=[PORTMUX_TCBROUTEA,5,xxxx1110,0,1]
OPTION20=TCB1
OPTION20VALUE=[DEFAULT_PA3,ALT_PF5]
OPTION20DATA=[PORTMUX_TCBROUTEA,5,xxxx1101,0,1]
OPTION21=TCB2
OPTION21VALUE=[DEFAULT_PC0,ALT_PB4]
OPTION21DATA=[PORTMUX_TCBROUTEA,5,xxxx1011,0,1]
OPTION22=TCB3
OPTION22VALUE=[DEFAULT_PB5,ALT_PC1]
OPTION22DATA=[PORTMUX_TCBROUTEA,5,xxxx0111,0,1]


also put them in 1 line :
Code:
config PORTMUX=overwrite,TCB0=ALT_PF4, TCB1=ALT_PF5
 

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

Bascom Member



Joined: 10 May 2005
Posts: 2
Location: Austria

PostPosted: Thu Sep 11, 2025 3:36 pm    Post subject: Reply with quote

Thanks both for your swift and proper reply.

This compiles without errors now.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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