View previous topic :: View next topic |
Author |
Message |
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Sat Jun 07, 2014 7:24 pm Post subject: Help with PCINT10 on ATMEGA324a |
|
|
Hello all,
I am porting code from an ATMEGA325 to an ATMEGA324a. I am having trouble getting the PCINT10 interrupt to fire. This is the code used:
Code: |
'Read the FFIT Output from the Module On PinB.2
Portb.2 = 1 'turn on pull up
Pcmsk1 = &B0000_0100 'set mask for port pin use
On Pcint1 Isr_ffit 'Ffit = B.2
Enable Pcint1
|
This is virtually the same code as what was in the M325, only the interrupt number was different.
Can anyone see what I did wrong?
Thank you,
Tim
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Sat Jun 07, 2014 9:58 pm Post subject: |
|
|
What is "PCINT" in Bascom?
Possible interrupts here http://wiki.mcselec.com/bavr/ENABLE
Maybe INT1 is what You looking for.
I think "PCINT" is only on the schematic |
|
Back to top |
|
|
Pikczu
Joined: 22 Jan 2006 Posts: 72 Location: Dublin, Ireland
|
Posted: Sat Jun 07, 2014 10:13 pm Post subject: |
|
|
No EDC
TSEYFARTH is asking about Pin Change Interrupt |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Sun Jun 08, 2014 11:23 am Post subject: Re: Help with PCINT10 on ATMEGA324a |
|
|
TSEYFARTH wrote: | Can anyone see what I did wrong? |
As always you should have provided a compilable sample, as then the potential helper don't has to create it.
Imho this is duty and a sign of kindness from the one seeking help, as such a sample is needed to make simulation possible.
In this case I've created it, looks like that:
Code: | $Regfile = "m324padef.dat"
$Crystal = 4000000
$hwstack = 32
$swstack = 8
$framesize = 24
Portb.2 = 1 'turn on pull up
Pcmsk1 = &B0000_0100 'set mask for port pin use
On Pcint1 Isr_ffit 'Ffit = B.2
Enable Pcint1
Enable Interrupts
Do
Loop
Isr_ffit:
Return |
The code works exactly as it should, at least to say by watching its behavior within an AVR-Studio 4 simulation, so the error must be elsewhere.
Did you check the electrical connections, as the footprint of ATM324 and ATM325 greatly differ? |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Sun Jun 08, 2014 7:03 pm Post subject: |
|
|
Hello MWS.
I apologize. I had gotten the problem fixed last night and did not update the post here. The code I posted worked perfectly, something else was getting in the ways. I do thank you for your time with posting your code sample. The meat of it is the same as mine and it does work in hardware.
Again, MWS, thank you for your post and your time.
Tim |
|
Back to top |
|
|
|