Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Xpin slewrate configuration

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

Bascom Member



Joined: 26 Feb 2016
Posts: 19

poland.gif
PostPosted: Sat Apr 25, 2020 8:21 pm    Post subject: Xpin slewrate configuration Reply with quote

Hello,

Code:
$lib "xmega.lib"

$regfile = "xm16e5def.dat"
$hwstack = 64
$swstack = 40
$framesize = 40

Dim A As Byte

Config Portd.1 = Output
Config Xpin = Portd.1 , Invertio = Enabled

Config Portd.2 = Output
Config Xpin = Portd.2 , Invertio = Enabled , Slewrate = Enabled

Do
Loop

End


Bascom AVR simulator sets &H40 on PORTD PIN1CTRL and &HC0 on PORTD PIN2CTRL. It means that bits 7. are 0 and 1. PORTCFG SLRCTRL is still 0.
XMEGA E MANUAL says: "12.13.14 PINnCTRL – Pin n Control Register Bit 7 – Reserved
This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written."

BASCOM-AVR help CONFIG XPIN:
Example
Config Xpin = Portc.0 , Slewrate = Enabled , Outpull = Buskeeper , Sense = Low_level

It suggests that slewrtate is enabled individually for Portc.0

XMEGA E MANUAL says:
"12.14.4 SRLCTRL – Slew Rate Limit Control Register Bit 3 – SRLENRD: Slew Rate Limit Enable on PORTD Setting this bit will enable slew rate limiting on port D."
It means that there is only one bit for setting slew rate for whole PORTD ( bit 2 SRLENRC) and PINnCTRL register is only for setting Inverted I/O Enable, Output and Pull Configuration and Input/Sense Configuration.
I expected unchanged bit 7. and changed PORTCFG SLRCTRL.

(BASCOM-AVR version : 2.0.8.2 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Tue Apr 28, 2020 9:11 am    Post subject: Reply with quote

i will have a look at it.
The E series has some differences compared to the other Xmega series. The core is the same but with some subtle changes.

p.s.
it is always best to write to support when you find a bug.

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

Bascom Member



Joined: 26 Feb 2016
Posts: 19

poland.gif
PostPosted: Tue Apr 28, 2020 1:59 pm    Post subject: Reply with quote

Yes, I checked A series. It is exactly like Bascom-AVR help and AVR simulator described above.
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