Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATTINY45 PWM on Port PB4

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

Bascom Member



Joined: 29 Apr 2015
Posts: 21

germany.gif
PostPosted: Sun Aug 07, 2016 9:14 pm    Post subject: ATTINY45 PWM on Port PB4 Reply with quote

Hi,
i'm searching for the correct code, to do a pwm on PB4 (ATTINY45).
This i tried (and much other things) but it doesnt work...

$Regfile="attiny45.dat"
$Crystal=8000000
$hwstack=40
$swstack=16
$framesize=32

config portb.0 = input
config portb.1 = input
config portb.2 = input
config portb.3 = input 'Eingang Taster
config portb.4 = output 'Steuerausgang

Config Timer1 = Pwm , Compare_B_Pwm = Clear_up , Prescale = 8

do 'test für PWM

PWM1B = 125

wait 5

PWM1B = 80

wait 5

loop

end

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
laborratte

Bascom Expert



Joined: 27 Jul 2005
Posts: 299
Location: Berlin

germany.gif
PostPosted: Sun Aug 07, 2016 10:30 pm    Post subject: Reply with quote

Seems to be a bug, you should report this to support.

When running your code in simulator, you can see that GTCCR is not set correctly for comparator B output mode. I assume that due to the complete different nature of timer1 in ATTINY45 (in respect to MEGAs) the compiler did not set the registers correctly. [edit: or the compiler assumes that ATTINY15 compatibility mode is used?]

As workaround you should set the registers for your need manually instead of using config timer1 statement.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5926
Location: Holland

blank.gif
PostPosted: Sat Aug 13, 2016 9:41 pm    Post subject: Reply with quote

The timer 1 was added to a new group for t25/45/85, but some important changes were not made which result in this bug. fixed in 2080.
_________________
Mark
Back to top
View user's profile Visit poster's website
chris101

Bascom Member



Joined: 01 Sep 2005
Posts: 46

denmark.gif
PostPosted: Sun Jun 11, 2017 9:33 am    Post subject: Reply with quote

When will this version be released?
_________________
Best Regards from.

Christian
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2158

netherlands.gif
PostPosted: Mon Jun 12, 2017 9:24 am    Post subject: Reply with quote

It's already released, check this http://register.mcselec.com/login.php
You need to download the full setup.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
chris101

Bascom Member



Joined: 01 Sep 2005
Posts: 46

denmark.gif
PostPosted: Mon Jun 12, 2017 3:02 pm    Post subject: Reply with quote

Thanks. Not easy to see when the software tells you that the latest version is 2.0.7.8.
How i discover that in the future? The 2.0.8.0 splash screen still says current version is 2.0.7.8 ??

_________________
Best Regards from.

Christian
Back to top
View user's profile
nobner

Bascom Member



Joined: 29 Apr 2015
Posts: 21

germany.gif
PostPosted: Tue Aug 22, 2017 7:58 am    Post subject: Reply with quote

Hello,
i tried today to get the 2080 as mentioned in the posts before.
But i can only find 2078 as newest update version?
There is also a license file 2079 - is this the newest?
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2158

netherlands.gif
PostPosted: Tue Aug 22, 2017 11:31 am    Post subject: Reply with quote

You need to download the full setup.
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
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