Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use PCINT4? #178

Closed
brother-yan opened this issue Jul 24, 2021 · 6 comments
Closed

How to use PCINT4? #178

brother-yan opened this issue Jul 24, 2021 · 6 comments

Comments

@brother-yan
Copy link

Since mega328p doesn't have this interrupt vector. How to use this interrupt in lgt8f328p? Thanks!

@LaZsolt
Copy link
Collaborator

LaZsolt commented Jul 25, 2021

I never use pin change interrupts. I found few examples for you:
https://thewanderingengineer.com/2014/08/11/arduino-pin-change-interrupts/
https://www.teachmemicro.com/arduino-interrupt-tutorial/
https://github.com/NicoHood/PinChangeInterrupt
I think it is quite simple. You need only change the names of ports or interrupt vector names.

@dwillmore
Copy link
Collaborator

@brother-yan what was your results with LaZsolt's suggestions?

@LaZsolt
Copy link
Collaborator

LaZsolt commented Jan 26, 2023

Since the @brother-yan hasn't loggen in the Github for two years, I close this issue.

@LaZsolt LaZsolt closed this as completed Jan 26, 2023
@jayzakk
Copy link
Collaborator

jayzakk commented Jan 26, 2023

That's perfectly fine, I added them in #40

@brother-yan
Copy link
Author

brother-yan commented Feb 13, 2023

@dwillmore I don't use LGT MCU since 2020. I have a solution:
just add a *.S file in your sketch folder

添加文件:IVT_extended.S

#include <avr/io.h>

#ifdef __AVR_MEGA__
  #define XJMP jmp
  #define XCALL call
#else
  #define XJMP rjmp
  #define XCALL rcall
#endif

.section .vectors, "ax", @progbits
  .weak __vector_26
  ;.set __vector_26, __bad_interrupt
  XJMP  __vector_26
  .weak __vector_27
  ;.set __vector_27, __bad_interrupt
  XJMP  __vector_27
  .weak __vector_28
  ;.set __vector_28, __bad_interrupt
  XJMP  __vector_28
  .weak __vector_29
  ;.set __vector_29, __bad_interrupt
  XJMP  __vector_29

即可

@LaZsolt
Copy link
Collaborator

LaZsolt commented Feb 14, 2023

Thank you for the answer.-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants