pin change interrupt - general questions

Hello

i want to use serial3 to get output via usb on a console but it doesnt work. i think it maybe that the alternative funcionality, the pcint9/pcint10 are used, and thats why it doesnt work. these pins might be used for pin change interrupt but i dont know what that is for… so like the subject says: what is it? why should i use it? how do i disable it? are these pins set to pcint9/10 from the start?

maybe you will think that I could find out myself but i have problems understanding the manuals completely so i thought someone might know and tell me

thanks for your help

What does your sketch do that might be using them for an alternative functionality? Can you post the code here?

Geoff

very easy code:

void setup(){
Serial3.begin(9600);
}
void loop(){
  Serial3.write("CE");
}

if i run this and listen to serial2, it works

void setup(){
Serial2.begin(9600);
}
void loop(){
  Serial2.write("CE");
}

you see. same code, only a different output-channel, eh?

for listening, i use a com-serial connection with putty...
thing is that tx3/rx3 could also be configured to be a pin change interrupt(look page 94: http://www.atmel.com/Images/doc2549.pdf) ... so i want to try to configure it. I'm not familiar with all this stuff so i don't know how to do it...
what would you say does table 13-29 in doc2549.pdf say? i dont understand the table... but i think it tells something about how to configure the pin, doesn't it?

Hi

To use them as interrupt pins you need to program them to be that - which your sketch doesn’t.do. Google pin change interrupt and you’ll see articles on this subject, there’s even an old one on the Arduino playground, and there are libraries which have been written to make it easy to do.

But, since your sketch doesn’t do any of that you’ll not be seeing that effect. It’s like all the analog pins can be used for digital, and some of the pins are external interrupt pins, or are capable of hardware PWM also…if you choose to talk to them that way and do the relevant setups in your code.

it’s not obvious to me from what you’re saying what’s going wrong, but we need to look elsewhere. Do the other Serial ports work as advertised for you?

Cheers !
Geoff

The PCInt is basically just a monitor on the pin state which triggers an interrupt routine if the state of that pin changes (high to low, or low to high). It doesn't affect their normal operation. It's perfectly valid to enable PCInt on a pin, and then program the pin to wiggle from 0v to Vcc either by manually setting the pin state, or using PWM for instance. In fact, the datasheet mentions doing this as a way to generate software interrupts.

Suffice to say, this is not why serial doesn't work.

thanks for your answers!

SirNickity:
[...]It doesn't affect their normal operation. [...]

ok.

strykeroz:
[...]but we need to look elsewhere..Do the other Serial ports work as advertised for you?

yes, i tried the same code. Just serial2.[...] or serial1.[...] instead of serial3.[...] and it worked perfectly..
Any ideas, what might cause this problem?

If it was about functionality, I'd just ignore this issue and use a software serial but I'd still like to know what it is about.