Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ADC SPI and AVR MKII connection problem

Status
Not open for further replies.

kunal5959

Junior Member level 3
Joined
Jul 26, 2011
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,644
I am trying to connect my ATMEGA128 board with ADC128s102 for my prj. The board is already functioning with programming interface ISP AVR MKII. AS shown in the diag the MISO and MOSI are connected as shown . Since the ADC uses SPI i have connected the MISO MOSI and SCK to corresponding pins on uC. Now since the SCK here is common for both Programmer and ADC i am not able to proogram my uC board because the "AVR studio shows not able to enter programming mode error". As shown in the data sheet while connecting multiple devices to SPI we just have to divide the SCk MISO and MOSI. Or may be i have misunderstood.

Can anyone suggest what is the best possible way to establish a error free communication between uC and AVRMK2 & uC and ADC using the SPI interface on the uC??
 

Attachments

  • ADC SPI and AVR MKII connection problem.png
    ADC SPI and AVR MKII connection problem.png
    13.5 KB · Views: 144

maybe your ADC is being 'selected' and interfering the communication between the programmer and the micro... please read the datasheet of your ADC and check the correct value for and idle Chip Select, most SPI interfaces (and by the name nCS) uses the Chip Select (pin CS, SS) as active low, that means that most of the time it should be logic 1 and when you want to communicate with this device, you set it to logic 0... when the micro is being programmed, the floating state of PA5 could be understated as 0 or 1 or whatever by the ADC, messing the communication...

in other words, add an external pull up resistor (10k should be enough) from nCS to VCC (the same Vcc of the ADC)...
 

Hi,

The AVR SPI is only active when reset is not asserted.
But during programming reset is asserted.

Be sure the AVR is in Reset during programming.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top