To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 3261
3260  |  3262
Subject: 
Re: Interrupt for serial data
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Fri, 13 Feb 1998 22:39:57 GMT
Original-From: 
Fred G. Martin <fredm@%StopSpam%media.mit.edu>
Viewed: 
1399 times
  
Jan-Sipke,

You're really pretty far away from having this work.  It's not just a
matter of redirecting the serial interrupt; when you get there, you
have to:

* store incoming character in a buffer
* advance the buffer pointer
* check the buffer for overruns

then you need a separate subroutine which fetches the character from
the buffer (checking first if there is anything there), and decrements
the buffer point.

learning how to write interrupt code is probably the hardest part of
assembly programming.  my best advice to you is to simply write code
on the PC side to slow down your transmit character rate until things
work. and make sure on the HB side, you're in a tight loop receiving
characters when communications are in progress.

fred








In your message you said:
I've decided to write an interrupt routine for the handling of serial data on

the Handy Board. An example of an interrupt routine is given in the Handy Boa • rd
technical reference. This works like a charm. I've modified it to use the SCI

interrupt. The code is listed below.

No interrupts seem te occur. The test is like this:

* Start IC
* load myfile.icb
* load myfile.c  (* in main : *)
  poke (0x3c, 1);
  printf ("%d", foo);
  int_init (0);
  start_press ();
  printf ("%d", foo);
* Exit IC
* reset Handy Board
* it prints: 55
* send a character to the Handy Board (in Borland Pascal)
* press Start button
* it prints: 55


Can anyone see the mistake here?
Hope I'm not too annoying with all my questions.

Jan Sipke van der Veen



#include "include\6811regs.asm"

subroutine_int_init:
#include "include\findx.asm"
   LDD   SCIINT,X
   STD   interrupt_code_exit+1

   LDD   #interrupt_code_start
   STD   SCIINT,X

* Receive Enable (bit 2) +
* Transmit Enable (bit 3) +
* Receive Interrupt Enable (bit 5) = $2C
   LDAA  #$2C
   STAA  SCCR2,X

   RTS

variable_foo:
   FDB   55

interrupt_code_start:
   LDD   #42
   STD   variable_foo

interrupt_code_exit:
   JMP   $0000




Message has 1 Reply:
  Re: Interrupt for serial data
 
(...) Sipke obviously realizes that more work is needed, and justs want to get to step 1 first by recognizing the interrupt. That is exactly what I would do too. I've been thinking about writing an interrupt-driven serial receive routine too, but (...) (27 years ago, 13-Feb-98, to lugnet.robotics.handyboard)

Message is in Reply To:
  Interrupt for serial data
 
I've decided to write an interrupt routine for the handling of serial data on the Handy Board. An example of an interrupt routine is given in the Handy Board technical reference. This works like a charm. I've modified it to use the SCI interrupt. (...) (27 years ago, 13-Feb-98, to lugnet.robotics.handyboard)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR