Forum Index > Projects > Micro-readerboard project support
 unable to program the microcontroller
 |  Printable Version
By: Windell (offline) on Thursday, December 18 2008 @ 05:57 PM PST  
Windell

Yep, I fixed the decimal point problem too-- we were using too much ram as well as flash space, when compiled with the new compiler. Frown


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Thursday, December 18 2008 @ 06:04 PM PST  
q209

See - I just gotta learn more! (and while I agree with what you said on the documentation thread, I *did* find some good books via google books that I've asked Santa about... Smile

Anyway, you da man! I'll be trying tonight.

Thanks for your help!


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: q209 (offline) on Thursday, December 18 2008 @ 06:08 PM PST  
q209

Oh - forgot to ask: what would be the impact of storing the strings in Flash, other than the 10k cycle limit?


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: q209 (offline) on Thursday, December 18 2008 @ 10:03 PM PST  
q209

Windell - it works (mbr 2.1, avr toolchain dec 08)! Thanks so very much.

Now I have to put my geek hat on and learn the details so I know why! Smile


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Thursday, December 18 2008 @ 10:08 PM PST  
Windell

Quote by: q209

Oh - forgot to ask: what would be the impact of storing the strings in Flash, other than the 10k cycle limit?

The 10k limit doesn't really apply here-- you can read from flash as many times as you like, it's just that you can't go change the flash contents all the time without it failing.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Thursday, December 18 2008 @ 10:24 PM PST  
q209

So, in theory, one could use much longer and/or more strings... assuming you could keep someone's interest in reading longer strings.

A subject for experimentation... add a counter that would increment strings after 5 - 10 times, add .... hmmm.

8D


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Thursday, December 18 2008 @ 10:51 PM PST  
Windell

You can also change it to use one *very long* string by incrementing the string number after each one finishes.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Friday, December 19 2008 @ 08:17 AM PST  
q209

Hmmmm... a problem I noticed last night. Even though pin 8 isn't grounded, all I get is string set 2. If I tie 8 to the high rail with a 10k resistor on startup, it works (reads bit_is_clear as 'no'Wink. I've checked with my VOM; pin 8 on the breadboard is floating. Suggestions?

By the way: a good source of AVR (and GCC) reference material: http://users.rcn.com/rneswold/avr/


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Friday, December 19 2008 @ 11:10 AM PST  
Windell

It's sometimes possible that a *weak* connection to the pin is enough to pull it down-- dirt, flux, and fingers can all work. I haven't seen an example of the problem that wasn't actually due to external influence.

As far as the voltmeter goes, that's not a useful test unless you've made some changes to the firmware: It should go high for something of order one microsecond total.

In your case, I bet that it's the *breadboard* that's causing the problem. Breadboards have a lot of capacitance, probably too much for that pin to get all the way high in one microsecond.

Where it says in the code

PHP Formatted Code
asm("nop");     // Wait one cycle for input to be ready -- this is important.



Try changing that to about 5 or 10 lines of the same instruction-- up to the limits of your memory. See if that makes a difference.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Friday, December 19 2008 @ 11:43 AM PST  
q209

Trying to let it stabilize with nop's doesn't seem to work (used 'shortdelay'Wink. Then again, my breadboards are decades old! My newer ones currently have other micros living on 'em. To be honest, though, I don't think I've ever had a stable tri-state pin without a pulldown or a pullup...

I intend to solder in a switch (once I pick up some 20 pin sockets) to flip between the display modes. I'll probably install a dpst, so I can always put in a 10k resistor if needed. No biggie.

If you don't mind, what does this do:

PORTD |= _BV(PD4); // D4 High

I should say "why", rather.

Thanks for all your help!


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Windell (offline) on Friday, December 19 2008 @ 11:53 AM PST  
Windell

Breadboards are hell.
http://www.national.com/rap/Story/0,1562,8,00.html

>PORTD |= _BV(PD4); // D4 High

That sets pin D4 to be high. Since pin D4 was defined as an input when that line executes, it actually enables the internal pull-up resistor, which is a weak 10k resistor to the positive voltage rail. This pulls D4 high *if* it would otherwise be floating, but is too weak to pull it high if it's (for example) hooked with a wire to ground.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: q209 (offline) on Friday, December 19 2008 @ 12:42 PM PST  
q209

My. My! Didn't know they were *that* bad - it would explain some problems I've run into before! Confused

Well, heck, they're still good for low freq analog...

So I guess the internal pullup will be good enough when off the breadboard, and all I'll need is a spst for string switching.

Thanks again!


Kevin


Forum Henchperson
Henchperson

Status: offline

Registered: 12/15/08
Posts: 34
Central Valley, CA

Profile Email    
   
By: Anonymous: Oleg () on Sunday, April 26 2009 @ 12:44 PM PDT  
Anonymous: Oleg

Kevin, just in case you are still interested in old WinAVR - get it from http://sourceforge.net/project/downloading.php?group_id=68108&filename=WinAVR-20070122-install.exe&a=36802473





       
   



 All times are PDT. The time is now 11:09 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?