AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
ATmega88 TCCR0A(B) issue and 2 other proposals (Read 7103 times)
kyle_m
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 1

ATmega88 TCCR0A(B) issue and 2 other proposals
04/05/11 at 15:13:17
 
Hi, guys! You've done a really great job!
Many thanks from sole developers and fans of electronics, like me, for free version!
Today I have three points to report, as I faced this issues in my own development process.
I'm providing my application written for WinAVR, to back up my words.
Notice, that I have not tested it on hardware, I've just faced some disagreements
with official [b]ATmega88[/b] MCU documentation (MCU ref is sure to be the last one I've
downloaded it couple of days ago from atmel)

1) Simulation environment do not respect internal pull-up resistors, which can be
switched on by writing 1 in port while it is configured as input! No matter if I tried this,
only external pull-ups make pin go hi, otherwise it stays undefined.

2) built-in peripheral Timer0 TCCR0A and TCCR0B are seem to be mixed up.
Writing clock select bits in TCCR0B has no effect, while writing them in TCCR0A does the job.
I had to place #ifdef for workaround in my app, but I believe it could be more complicated,
as I did not try other bits and pwm.

3) LED diodes can have anode only on VDD. I see, it's not crucial, but I'd like to have
way to turn it over, and have anode on pin. It's also a possible scenario, isn't it?

That's all, hoping you'll find my points useful. Overall it works fine, thanks once more,
and keep it up)
Back to top
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #1 - 04/06/11 at 09:50:43
 
Hi,

Indeed, the Mega88 internal model contains a lof of inaccuracies.

This is fixed by using the new user-defined capability, by which new AVRs or microncontrollers can be added.

Look at the AtMege188b.ini file, which follows this coding style, and peripherals are correctly coded, mainy by our forum member "ThVortex". In the Project File you have to put:

.MICRO "AtMega188b"

To code the Mega88 it is a matter only of changing the memory sizes...
Back to top
 
 
WWW   IP Logged
Igor
YaBB Newbies
*
Offline



Posts: 2

Gender: male
Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #2 - 04/06/11 at 10:37:49
 
Hi,

[quote]Look at the AtMege188b.ini file
.MICRO "AtMega188b"[/quote]

Do you mean "ATmega168b"? ATmega168b.ini exists in VMLab, but ATmega188b is missing...

kyle_m, to use ATmega168b with AVR-GCC you have to change your project:
1) Replace [font=Courier New].GCCMAKE AUTO[/font] with [font=Courier New].GCCMAKE "mymake.mak"[/font] in your project file.
2) Rename __auto.mak file to mymake.mak.
3) Change [font=Courier New]MCU = atmega168b[/font] to [font=Courier New]MCU = atmega168[/font] in mymake.mak.

After these changes Timer/Counter0 works better, but Timer/Counter2 still looks like in ATmega8, but not in ATmega48/88/168...

Back to top
 
 
  IP Logged
vuokko
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 2

Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #3 - 04/06/11 at 11:02:40
 
Is this workaround also for this:  [url]http://www.amctools.com/cgi-bin/yabb2/YaBB.pl?num=1294335103/7#7[/url] problem? In future could VMLAB use Atmel's designing data which is provided with AVRStudio. Some internal MCUs and possibility to take the XML file and create own micro from them? Without Windows development system.

This is second hand information as I don't have AVR studio installed.
Back to top
 
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #4 - 04/06/11 at 11:43:06
 
Yes, sorry for the typo error. I mean Mega168b
Back to top
 
 
WWW   IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #5 - 04/07/11 at 18:27:47
 
[quote author=4B68727676726E78697C781D0 link=1302012798/0#3 date=1302084160]Is this workaround also for this:  [url]http://www.amctools.com/cgi-bin/yabb2/YaBB.pl?num=1294335103/7#7[/url] problem?
[/quote]
Yes, using "[tt].MICRO ATmega168b[/tt]" in your project will also workaround the problem that user Milwaukee was describing with the flag register. Make sure to download the latest [url=http://thvortex-vmlab.googlecode.com/files/useravr-0.6.1.zip]useravr-0.6.1.zip[/url] from my [url=http://sites.google.com/site/thvortex/vmlab/useravr]website[/url] to get all the fixes.

I could also create an "[tt]ATmega88b.ini[/tt]" file for those who need the correct timer models on that processor.
Back to top
 
 
WWW   IP Logged
Igor
YaBB Newbies
*
Offline



Posts: 2

Gender: male
Re: ATmega88 TCCR0A(B) issue and 2 other proposals
Reply #6 - 04/08/11 at 09:26:29
 
[quote]I could also create an "ATmega88b.ini" file for those who need the correct timer models on that processor.[/quote]
It would be great. And "ATmega48b.ini" too, please.

Thank you.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print