I am confused too.I think it would be a good idea if you describe your project in more detail. It is unclear how many and which pins you are expecting to use and for what purpose.

Just to be clear that we are talking about the same:

The Capacitive Sensing Library ned a sense and receive pinhttp://playground.arduino.cc//Main/CapacitiveSensor?from=Main.CapSense

If you are using TinyISP and knockbang , the serial output form attiny is pin PB1 (physical pin 6) connected to pin pin 12 on the UNO,This is also the reason why you should not use this pin as sense pin, as I tryed to explain

I am confused too.I think it would be a good idea if you describe your project in more detail. It is unclear how many and which pins you are expecting to use and for what purpose.

Just to be clear that we are talking about the same:

The Capacitive Sensing Library ned a sense and receive pinhttp://playground.arduino.cc//Main/CapacitiveSensor?from=Main.CapSense

If you are using TinyISP and knockbang , the serial output form attiny is pin PB1 (physical pin 6) connected to pin pin 12 on the UNO,This is also the reason why you should not use this pin as sense pin, as I tryed to explain

That leaves you with 2 pins (three if you use the reset pin)

ok this is where I am confused. I have the capacitive sensor hooked up to the attiny not the arduino (maybe that is where the confusion is). you say "using 0 and 1 you are interferring with MISO" I don't see how that will interfere with MISO on attiny...? nor did I know it even had it.

Those sketches I have up there are both uploaded to the attiny, I have capacitive sensor on 0 and 1 of attiny. and reading serial from attiny on PB3 (I thought this was default, I have always used this and it used to work fine) going into Tx of arduino. But I also leave it plugged into the programming board, but not sure if this will cause any unexpected errors.

ok this is where I am confused. I have the capacitive sensor hooked up to the attiny not the arduino

So do I

Quote

nor did I know it even had it.

It does, see the picture above

Quote

you say "using 0 and 1 you are interferring with MISO" I don't see how that will interfere with MISO on attiny...?

Look at the picture PB1 (or 1) is MISO used by TinyISP to communicate with your Arduino

Quote

I have capacitive sensor on 0 and 1 of attiny

Again 1 is MISO

Quote

and reading serial from attiny on PB3 (I thought this was default, I have always used this and it used to work fine)

No, the default is PB1 when you are using TinyISP.

If you use TinyDebugSerial, the default is PB3

Ohhhh, I was confusing myself because I was using a different core last time. it definitely had a different pin, i made suggestions you made and all is well. thanks for your patience everything is working as expected. so using TinyISP is 0 the serial in( like Rx on arduino)? this relationship kind of confuses me because I have output from attiny going into Tx of arduino, which I thought was transmit. I would expect it to go into Rx.

any idea what needs modifying to make TinyISP and TinyDebugKnockBang work on a Mega2560? I could probably figure out the pin changes, but I don't know what to put to replace the ( __AVR_ATmega328P__ ) #define's.

I have a version that may work but I have no way to test it. If you agree to provide feedback (that includes success) then I'm willing to publish.

I'll be willing to test it out also.

Excellent. Is delivery via Github acceptable?

If you don't mind, I'd like you to review the pin assignments for mistakes / opinions...

LED_PIN is assigned to digital pin 13. TinyISP uses a single LED for status. I chose the on-board LED.

TICK_TOCK_PIN is assigned to digital pin 47. The "Tick Tock" pin is used as a basic chronograph. When the pin toggles a timestamp is output. It allows basic performance monitoring and tuning. I have a version that uses Input Capture so I try to assign TICK_TOCK_PIN to ICP1 (Input Capture for Timer 1).

Knock-Bang is always assigned to MISO which is PB4 / digital pin 50.

The SPI pins are...MISO is 50.MOSI is 51.SCK is 52.SS is 53.

The SPI pin assignments are only relevant when PROGRAMMER_SPI_CLOCK == SLOW. I believe the Arduino core provides the assignments.

There are two more things that will have to be assigned pins: "Tuning Signal" and "Alternate Knock-Bang".

The Tuning Signal is one-half of a much improved Tiny Tuner. For the m328 processor the Tuning Signal is currently placed on a timer 2 output (OC2B). The only requirement is the pin must be a timer output. A pin close to the target (close to the SPI pins) is helpful.

There are times when MISO cannot be used for Knock-Bang. The Alternate is simply another choice for Knock-Bang. The only requirement is the pin has to support Pin Change Interrupts. I typically choose this pin based on physical location: a pin close to the SPI pins that does not conflict with any other pin assignment.

Finally, the Serial Relay code will have to be updated (this is a note to myself).

Quote

I've actually been trying to play with TinyISP on my mega2560 but didn't get too far with it.

The code is very poorly structured for porting so it's certainly understandable you ran into problems. I had to grep for a few things and I wrote the thing.

I was able to at least get the TinyISP to build on the mega2560 and program a few ATtiny84/85s. But not get the serial relay to work. I didn't try knock-bang because I figured that required more work. I'll wait for your code.