MPLAB Snap

Go To Last Post
153 posts / 0 new

Pages

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

I am happily debugging an at85 with SNAP and now need to want to use the TWI interface. I have 4k7 pullups fitted.

On this chip the SDA/MOSI and SCL/SCK are shared pins.

 

From the reading that I had done, I thought the SNAP ISP interface was high impedance when operating in DW mode. It seems not....

 

MOSI/SDA seems OK.

If I set it to an input from the at85 side it is pulled up to 5V. If I set to an output I can drive it high/low.

 

SCK seems to have a load or perhaps a clamp applied from the SNAP side.

If I set it to an input from the at85 side, the pin reads around 2V. This seems like a pull-down f around 3k. I didn't record what happens when I set to an output.... and have now disconnected for fear of cooking something.

Is this expected behaviour, or do I have a problem that I don't understand.

 

Once I have enabled DW I don't need the ISP/SPI interface but had left it connected rather than removing/replacing. I have now disconnected MOSI/MISO/SCK and can continue debugging with Vcc, nReset and Gnd. It would be nice not to have to change teh wiring.

 

All thoughts welcome as always.

Thanks in advance.

 

regards
Greg

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

You don't need to do anything for the SPI / debugWIRE interface.  i.e. the SNAP works out of the box.

 

If you attach external electronics to the ISP pins it will interfere with SPI.   Just like any other SPI (ISP) programmer.

 

The rule of thumb is : use real-world resistor pullups on external /CS pins when you have other SPI devices on the bus.

 

If you have I2C pullups and external I2C devices on the ISP pins make sure that they are powered.

 

If in doubt disconnect ISP pins after you have enabled debugWIRE.

Disconnect external electronics before re-connecting ISP pins when you want to disable debugWIRE.

 

In practice you will leave the tiny85 in debugWIRE mode throughout the development process.

Just remember to restore ISP when the project is complete.

 

David.

 

Last Edited: Sat. May 21, 2022 - 08:18 AM

Pages