Newbie - Pullup Resistors

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Group,

I am a software engineering trying to learn to use AVR microcontrollers. Sorry I do not know any electrical engineers to example the circuit side of things to me.

I have a Atmega16 and I wish to measure temperature using the DS1621 via 2-wire protocol.

I have my circuit set-up in my STk500, however I never get any temperature readings from the DS1621 in program. I am supply the 5 V off the VTG pin on PortB.

Do I need to pull up resistors to 5V on SDA and SCL?

(I have seen examples with PIC that have these pullup resistors, typically 4k7?)

Is it possible to debug using AVR studio with GCC on the STK500?
Are there any instructions available to explain how to do this.

Stuart

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes.

Yes. see VMLAB on amctools.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes and no.

I had developed a project with two boards - one of them was motherboard and other of them was connector board.

With interfacing via SCL SDA on motherboard, microcontroller once configured would carry out the job.

But the peripherals at the connector board did not and I had connected pull up resistors at SCL and SDA.

Conclusion - better use them

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You will have to invest in a JTAG interface to do in circuit debugging with the Mega16 (an STK500 will not do it).

When interfacing with I2C (two wire) you need external pullup resistors. I have tried several values of resistors using whatever the normal TWI speed is with good success. I think I finally used 1.8k in my last design.

Try the TWI code on Atmel's site if you can't get your own working. It takes some editing of the header files to make them compile with AVR-GCC, but its fairly easy to figure out.