View previous topic :: View next topic |
Author |
Message |
KenHorse
Joined: 16 Jul 2004 Posts: 523
|
Posted: Mon Jun 08, 2020 8:33 pm Post subject: ISP programming & AVRISP MKII |
|
|
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 |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Jun 09, 2020 8:54 am Post subject: Re: ISP programming & AVRISP MKII |
|
|
KenHorse wrote: | Any thoughts? |
Add a pullup to the ISD4003's SS-pin. |
|
Back to top |
|
|
KenHorse
Joined: 16 Jul 2004 Posts: 523
|
Posted: Tue Jun 09, 2020 4:08 pm Post subject: |
|
|
Quote: | when SS is also 4.95 volts. |
|
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Jun 09, 2020 7:00 pm Post subject: Re: ISP programming & AVRISP MKII |
|
|
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 |
|
|
KenHorse
Joined: 16 Jul 2004 Posts: 523
|
Posted: Tue Jun 09, 2020 8:29 pm Post subject: |
|
|
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 |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Jun 09, 2020 8:57 pm Post subject: |
|
|
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 |
|
|
KenHorse
Joined: 16 Jul 2004 Posts: 523
|
Posted: Wed Jun 10, 2020 1:44 am Post subject: |
|
|
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 |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Wed Jun 10, 2020 9:07 am Post subject: |
|
|
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 |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
|
Back to top |
|
|
|