View Single Post
  #4   Spotlight this post!  
Unread 27-01-2008, 21:00
7-11number1 7-11number1 is offline
ROAR.
FRC #1711 (RAPTORS)
 
Join Date: Sep 2007
Rookie Year: 2006
Location: Traverse City, Michigan
Posts: 46
7-11number1 will become famous soon enough
Re: IFI Loader - Advanced Console Debugging getch()

Thanks.. I found the code. Just 9-easy steps to an interactive terminal window.
Nine things must be done before this software will work
correctly:

1a) FRC-RC: As this software is intended to replace IFI's
serial port driver, the call to Serial_Driver_Initialize()
in user_routines.c / User_Initialization() should be
removed or commented out. In addition, all references to
"user_Serialdrv.c" and "user_Serialdrv.h" must be removed
from the project and all project source files.

1b) EDU-RC: As this software is intended to replace IFI's
serial port driver, the call to Initialize_Serial_Comms()
in user_routines.c / User_Initialization() should be
removed or commented out. In addition, all references to
"printf_lib.c" and "printf_lib.h" must be removed from
the project and all project source files.

2) You must add the serial_ports.c/.h source files to
your MPLAB project.

3) A #include statement for the serial_ports.h header
file must be included at the beginning of each source
file that uses the serial ports. The statement should
look like this: #include "serial_ports.h".

4) If you intend to use the C18 output stream functions,
a #include statement for the stdio.h header file must be
included at the beginning of each source file that calls
any of these functions. The statement should look like
this: #include <serial_ports.h>.

5) Init_Serial_Port_One() and/or Init_Serial_Port_Two()
must be called from the User_Initialization() function
located in the user_routines.c source file.

6) The interrupt handler(s) must be installed in the
InterruptHandlerLow() function located in the
user_routines_fast.c source file. See the accompanying
copy of user_routines_fast.c to see how this is done.

7) Decide what functionality you need and comment out the
#define ENABLE_SERIAL_PORT_xxx_yy entries in serial_ports.h
as necessary. As an example, if you only need to send data
using serial port one and would like to reclaim the resources
used by serial port two and serial port one's receiver
source code, the top of the serial_ports.h file would look
like this:

// comment out the next line to disable all serial port one
// receive functionality
// #define ENABLE_SERIAL_PORT_ONE_RX

// comment out the next line to disable all serial port one
// transmit functionality
#define ENABLE_SERIAL_PORT_ONE_TX

// comment out the next line to disable all serial port two
// receive functionality
// #define ENABLE_SERIAL_PORT_TWO_RX

// comment out the next line to disable all serial port two
// transmit functionality
// #define ENABLE_SERIAL_PORT_TWO_TX

By default, both serial ports and their respective receive
and transmit sections are enabled.

8) As the default output device for C18's output stream
functions is the null device, you'll presumably want to
change the value of stdout_serial_port to "SERIAL_PORT_ONE"
or "SERIAL_PORT_TWO" if you want to see printf()'s output.
User_Initialization() is a good place to do this.

9) To support terminal emulation software, \r\n should
be used instead of just \n in the printf() format string.