Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ISP programming & AVRISP MKII

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR
View previous topic :: View next topic  
Author Message
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Mon Jun 08, 2020 8:33 pm    Post subject: ISP programming & AVRISP MKII Reply with quote

For well over a decade, I've been using the programmer mentioned in title with no problems with either a Mega 128 or 2561 (which use the PE0/PE1 or Rxd/Txd pins). I use the SPI hardware port to control an ISD4003 series Voicecorder IC and it's worked well for years. No external pullups have ever been needed on any of the SPI pins.

In a newer design, I want to replace the 128 with something smaller (like an ATMega 328) and that uses the SPI port pins for ISP programming and this is my issue. The datasheet of the ISD4003 states its MISO pin is tri-state and only active when SS is (active low, right?). Yet I measure 4.95 volts on that pin when SS is also 4.95 volts.

Anyway, apparently this voltage doesn't allow the AVRISP MKII to "see" the 328. It was suggested I place a 1K resistor in the MISO line between the AVR and the ISD, which does seem to resolve the problem but it seems "inelegant" and I'm concerned about some other issue cropping up.

Any thoughts?

(BASCOM-AVR version : 2.0.8.2 )
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Tue Jun 09, 2020 8:54 am    Post subject: Re: ISP programming & AVRISP MKII Reply with quote

KenHorse wrote:
Any thoughts?

Add a pullup to the ISD4003's SS-pin.
Back to top
View user's profile
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Tue Jun 09, 2020 4:08 pm    Post subject: Reply with quote

Quote:
when SS is also 4.95 volts.
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Tue Jun 09, 2020 7:00 pm    Post subject: Re: ISP programming & AVRISP MKII Reply with quote

KenHorse wrote:
Yet I measure 4.95 volts on that pin when SS is also 4.95 volts.

At condition reset pulled low?
Strong or weak current?
Are you sure where the level comes from, ATM328/AVRISP?
According datasheet ISD4003 does not drive MOSI high, it becomes tri-state if SS goes high.
Be aware that SS may not stay high while programming.
Pull reset low without programmer and measure again.
MWS wrote:
Add a pullup to the ISD4003's SS-pin.

Assume the static behavior you see is different than the dynamic one.
As reset is pulled low by the programmer, SS of ATM328 becomes tri-state and may float, going low, which in turn may activate MOSI of the ISD4003, which then messes up.
Back to top
View user's profile
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Tue Jun 09, 2020 8:29 pm    Post subject: Reply with quote

Haven't tried a reset yet (I will try your tests) but for fun, I removed the ISD so only the 2561 AVR is on the SPI lines. Interestingly, I'm still seeing 4.95 volts on both lines as before

Here's how I config the SPI port

Code:
Config SPI = Hard , Data Order = LSB , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 128 , NOSS = 0
SPIINIT


So it appears the AVR is sourcing the voltage
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Tue Jun 09, 2020 8:57 pm    Post subject: Reply with quote

KenHorse wrote:
So it appears the AVR is sourcing the voltage

Only as long till reset of the ATM328 is pulled low, any configuration becomes temporarily void then, all pins not used for programming, debugging and clock go tri-state.
This is imo your problem, ISD-SS is in an undefined state then, the pullup will fix it.
Back to top
View user's profile
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Wed Jun 10, 2020 1:44 am    Post subject: Reply with quote

As I suspected, adding a 47K pullup to the SS line made no difference (as I posted, completely removing the ISD from the equation still provided 4.95 volts on both the SS pin and now the MOSI lines of the Mega 2561)
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Wed Jun 10, 2020 9:07 am    Post subject: Reply with quote

KenHorse wrote:
adding a 47K pullup to the SS line made no difference

Please specify in what state of the ATM. Normal or reset state?
For normal state, well, the behavior is normal then, as the ATM's SPI-interface is active. The pullup has no effect then, as more you must have configured the SS-pin as output.
For reset state, MISO of ATM is going tri-state and you will be only able to measure leakage currents, which however may be high enough to imitate a result on a high-impedance meter.
Quote:
(as I posted, completely removing the ISD from the equation still provided 4.95 volts on both the SS pin and now the MOSI lines of the Mega 2561)

Again, as this is important, do you pull ATM reset low and do you get a strong current via MISO?
If both is the case, and independently then if the ISD is removed or not, you have a serious problem in your circuit, as it contradicts guaranteed behavior of all the parts mentioned in this thread.
Btw., as well the ISD-datasheet does specify the tri-state leakage current with 1-10 ľA, it does not state input current for SS, thus I would rather use a 4k7 pullup than a 47k one.
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Thu Jun 11, 2020 4:15 pm    Post subject: Reply with quote

I'd suggest to transfer this topic to:
AVR https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewforum&f=16
It's a pure hardware issue not connected with Bascom.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum