Author Topic: Using ports PB0 to PB3 as output although used for programmer  (Read 707 times)

0 Members and 1 Guest are viewing this topic.

Offline adanvascoTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Hi everyone. I recently got a sample LCD from Purdy Electronics http://www.purdyelectronics.com/products/displays/intchar.cfm (please use wisely ;)) and have been trying to connect it to the $50 robot.

My problem is that I need to use 4 consecutive ports ie. PB0 - PB3. This is a requirement of the library I'm using which can be found here http://extremeelectronics.co.in/avr-tutorials/using-lcd-module-with-avrs/. I could use the C port but I would have to sacrifice most of my ADC ports then.

So this is the question: can I use ports PB0 - PB3 which are currently being used to connect the hardware programmer? I know I'm not going to use the programmer while using the LCD, but I would have to configure port PB3 as output since PB0 - PB2 are currently not being used. So, changing PB3 to output would interfere with the programmer?

I forgot to mention, I'm using an ATmega8. I'm also open to new ways to achieve this. If you know of another library or a better way of doing this, please shout out!

BTW, the LCD is huge!!! It's almost an inch wider than my bot. It measures 4 1/2" by 1 3/4" by 3/5". But as we used to say in Cuba: "a caballo regalao' no se le mira el colmillo" ("Don't look a gift horse in the mouth")

Thanks.
Knowledge does not weigh.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Using ports PB0 to PB3 as output although used for programmer
« Reply #1 on: June 15, 2011, 11:27:58 AM »
Hi,

So this is the question: can I use ports PB0 - PB3 which are currently being used to connect the hardware programmer? I know I'm not going to use the programmer while using the LCD, but I would have to configure port PB3 as output since PB0 - PB2 are currently not being used. So, changing PB3 to output would interfere with the programmer?
On the PIC you can use the programming pins, but need to "isolate" the lines a bit if they're used as output with lowish impedance loads - this is only when using ICSP, if you program it out of the board (like on a solderless breadboard), they can be used freely without any precautions.
I'd assume the same goes with AVR's (as long as you don't use a boot loader of course).


BTW, the LCD is huge!!! It's almost an inch wider than my bot. It measures 4 1/2" by 1 3/4" by 3/5". But as we used to say in Cuba: "a caballo regalao' no se le mira el colmillo" ("Don't look a gift horse in the mouth")
Especially when you selected the model yourself  :D
You could have gone for a 1x8 and you wouldn't have had that problem  ;)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline adanvascoTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Re: Using ports PB0 to PB3 as output although used for programmer
« Reply #2 on: June 15, 2011, 01:03:42 PM »
Great! Thanks.

Especially when you selected the model yourself  :D
You could have gone for a 1x8 and you wouldn't have had that problem  ;)

Yeah, I just got greedy  ;D. They actually have a smaller 2x16. I really didn't look at the physical dimensions as I (incorrectly) thought the size would be the same; dependant only on the number of characters. Now I know.

It actually came out better than I expected.





Thanks again Soeren.
Knowledge does not weigh.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Using ports PB0 to PB3 as output although used for programmer
« Reply #3 on: June 15, 2011, 02:11:44 PM »
I like your Bot.

Offline adanvascoTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Re: Using ports PB0 to PB3 as output although used for programmer
« Reply #4 on: June 15, 2011, 05:09:56 PM »
Thank you. I used an old floppy disk drive case as the frame which is not very sturdy but at the same time is easy enough to work with. For the wheels I used two lemonade bottle caps. I was on a really tight budget and I think I managed to it make for around $30.

I actually got the LCD working  ;D



Edit: Forgot one more thing. The caster I took it from a mini roll-on perfume bottle.
« Last Edit: June 15, 2011, 05:16:08 PM by adanvasco »
Knowledge does not weigh.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.

Offline adanvascoTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Re: Using ports PB0 to PB3 as output although used for programmer
« Reply #6 on: June 17, 2011, 06:54:03 AM »
Good deal! I actually thought of getting a serial LCD but were not available (not 100% sure) as samples. And they are way more expensive than the regular ones.

But this looks pretty interesting. It'll give it a try on my breadboard and see what comes out.

Thanks a lot!
Knowledge does not weigh.

 


Get Your Ad Here

data_list