Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Help with PCINT10 on ATMEGA324a

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
TSEYFARTH

Bascom Member



Joined: 01 Jul 2006
Posts: 1054

usa.gif
PostPosted: Sat Jun 07, 2014 7:24 pm    Post subject: Help with PCINT10 on ATMEGA324a Reply with quote

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
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Sat Jun 07, 2014 9:58 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Pikczu

Bascom Member



Joined: 22 Jan 2006
Posts: 72
Location: Dublin, Ireland

ireland.gif
PostPosted: Sat Jun 07, 2014 10:13 pm    Post subject: Reply with quote

No EDC

TSEYFARTH is asking about Pin Change Interrupt
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Sat Jun 07, 2014 10:24 pm    Post subject: Reply with quote

Sometimes i wrote something and then think Rolling Eyes
In this case maybe config is needed http://wiki.mcselec.com/bavr/CONFIG_INTX
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Sun Jun 08, 2014 11:23 am    Post subject: Re: Help with PCINT10 on ATMEGA324a Reply with quote

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
View user's profile
TSEYFARTH

Bascom Member



Joined: 01 Jul 2006
Posts: 1054

usa.gif
PostPosted: Sun Jun 08, 2014 7:03 pm    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum