타이머 인터럽트에 대해서 질문드립니다.

fat81의 이미지

안녕하세요. 임베디드를 공부하는 학생입니다.
인터럽트를 보던 중에 궁금한 것이 있어서 질문 드립니다. 저는 현재 s3c2410 기반의 보드를 사용하고 있습니다.
이 중 timer4 를 이용해서 간단한 타이머 인터럽트를 테스트해 보려고 합니다.

제가 하고자하는 테스트 루틴의 대략적인 설명을 드리면 다음과 같습니다.
1 .먼저 timer4 의 레지스터를 초기화 세팅을 합니다.
2. 그리고 타이머 카운터 값이 0 이 될 때, 인터럽트가 발생합니다.
3. 인터럽트(irq)가 발생하면, 자동으로 0x18 번지로 점프하게 됩니다.
4. 여기서 메모리상의 인터럽트 루틴(0x30000018) 로 점프하게 됩니다.
5. 인터럽트 루틴에서는 아무 처리도 하지않고, irq_test 라는 함수를 branch 합니다.
6. irq_test 함수에서 irq test 라는 문자를 uart 로 출력합니다.

아래코드는 부트로더의 어셈 파일입니다.

0x18 b irq
...
...
...
0x30000018 irq_isr
                bl test_irq
...

아래코드는 커널입니다.

int main()
{
...
...
vh_timer_init();
...
...
}
 
void vh_timer_init(void)
{
	int timer_load_val;
 
	vh_rTCFG0 = 0x0f00;  
	vh_rTCFG1 = 0x0000;	
	timer_load_val = 50000000/(2*16*100); 
	vh_rTCNTB = timer_load_val;  
	vh_rTCON = (vh_rTCON & ~0x0700000) | 0x600000;  // auto reload, update, stop
	vh_rTCON = (vh_rTCON & ~0x0700000) | 0x500000;  // auto reload, no operation, start
}
 
void test_irq(void)
{
    printf("irq test!!\n");
    while(1);
}

위와 같이 했을 때의 문제점은 타이머 인터럽트가 발생하지 않는다는 것입니다. 프로그램을 실제로 수행해보면, irq test 라는 문자가 출력되지 않습니다. 또한 디버거(t32)를 통해서 확인해봐도 인터럽트가 발행하여 0x18 번지로 점프하지 않습니다.

제가 이해한 대로 타이머 인터럽트를 테스트를 한다고 만들었는데, 무엇지 잘못되었는지 잘 모르겠습니다.

혹시 아시분 있으시면 답변 부탁드립니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.