UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor srikanthvvs1
Visitor
3,607 Views
Registered: ‎04-03-2017

Interfacing Spartan 3E with Atmega microcontroller

Hi,

I am working on a project  desigining i2c slave module on spartan 3E . I completed the code and  now i need to send the serial data to spartan 3E, which has max voltage at pins (lvcmos33)  as 3.3v. But the microcontroller (atmega) i am using has output drive of 4.8v (SCA, SDL). So do i have to use level shifters or is there an other way.

 

I also read some where that using  series resistances (after some calculation) will do the job by limiting the current below 10ma.

But i didn't understood it well. 

 

Thank you,

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
3,592 Views
Registered: ‎09-05-2007

Re: Interfacing Spartan 3E with Atmega microcontroller

In I2C systems devices only drive Low (0). The High (1) level is created by pull-up resistors. So if you connect your pull-up resistors to 3.3v the maximum High level will be 3.3v.

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos
Scholar u4223374
Scholar
3,559 Views
Registered: ‎04-26-2015

Re: Interfacing Spartan 3E with Atmega microcontroller

As @chapman has said, the high voltage in an I2C system can be set just by setting the pull-up resistors.

 

Technically a 5V AVR requires the high-level voltage on I2C to be over 3.5V, but most people seem to have no trouble with the bus at 3.3V. To be safe a level shifter should be used.

0 Kudos
Visitor srikanthvvs1
Visitor
3,538 Views
Registered: ‎04-03-2017

Re: Interfacing Spartan 3E with Atmega microcontroller

Thanks for reply, and can you please tell me which pins on spartan 3e (XC3S500E) are best for SDA and SCL pins.
0 Kudos
Scholar u4223374
Scholar
3,531 Views
Registered: ‎04-26-2015

Re: Interfacing Spartan 3E with Atmega microcontroller

Pretty much any pins. Obviously you want some that are 3.3V-compatible (ie on an I/O bank powered by 3.3V), and you need to avoid fixed-function pins (eg. JTAG, power/ground, etc). Apart from that, pick any two pins near each other (to make wiring easier) that aren't being used.

0 Kudos
Visitor srikanthvvs1
Visitor
3,418 Views
Registered: ‎04-03-2017

Re: Interfacing Spartan 3E with Atmega microcontroller

Hai,
I tried to assign IOB pins from bank 0 to SCL and SDA (inputs from atmega), but xilinx software is not accepting any random I/O pin to act as SCL (clock in), and there is no problem in case of SDA.
I searched in net and found out there are only few pins through which we can supply clock externally (in this case SCL) like GCLKS,RHCLK'S.
(SCL drives a lot of flipflops in our slave module)
The problem here is all these pins (GCLKS) in spartan 3E are located in 100 pin Hirose connector but i don't have the connector.
So is there a way to go around this situation?
Or can we use those pins which are directly accessible?
0 Kudos
Xilinx Employee
Xilinx Employee
3,404 Views
Registered: ‎09-05-2007

Re: Interfacing Spartan 3E with Atmega microcontroller

Given the relatively low speed of I2C you would normally treat both SCL and SDA as logic signals in your design. Internally, you would use a high speed clock to sample these signals or drive them. It's worth noting that an I2C slave is also allowed to drive SCL to slow down the communication rate of the master (i.e. clock stretching) so SCL isn't a normal free-running 'clock'. Once you treat both SCL and SDA as ordinary bidirectional signals you will have no issues assigning them to any I/O pins. 

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos