View previous topic :: View next topic |
Author |
Message |
nobner
Joined: 29 Apr 2015 Posts: 21
|
Posted: Sun Aug 07, 2016 9:14 pm Post subject: ATTINY45 PWM on Port PB4 |
|
|
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 |
|
|
laborratte
Joined: 27 Jul 2005 Posts: 299 Location: Berlin
|
Posted: Sun Aug 07, 2016 10:30 pm Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Aug 13, 2016 9:41 pm Post subject: |
|
|
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 |
|
|
chris101
Joined: 01 Sep 2005 Posts: 46
|
Posted: Sun Jun 11, 2017 9:33 am Post subject: |
|
|
When will this version be released? _________________ Best Regards from.
Christian |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
|
Back to top |
|
|
chris101
Joined: 01 Sep 2005 Posts: 46
|
Posted: Mon Jun 12, 2017 3:02 pm Post subject: |
|
|
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 |
|
|
nobner
Joined: 29 Apr 2015 Posts: 21
|
Posted: Tue Aug 22, 2017 7:58 am Post subject: |
|
|
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 |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
|
Back to top |
|
|
|