forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EE-SIO rx

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
apache37



Joined: 04 Jun 2004
Posts: 76

PostPosted: Tue Sep 21, 2004 11:01 am    Post subject: EE-SIO rx Reply with quote

Hello,

I've built and installed the ps2 ee-sio per mrbrowns instructions. The tx works fine and I can see the messages pop thru securecrt and within my own code. The probelem I have is how to really test the rx side. I've looked through the other thread on the serial cable and are pretty sure I'm on the right via (directly below the tx).

Can someone provide a small code snippet on how to test? I've used sio_getc() and seems to return just the same funky "y" character all the time. I'm sure I'm just stupid. Right now I'm typing into the terminal app and trying to echo the input thru serial via printf to inlink.

Thanks in advance :)
Back to top
View user's profile Send private message
redcoat



Joined: 11 Aug 2004
Posts: 21

PostPosted: Tue Sep 21, 2004 6:53 pm    Post subject: Re: EE-SIO rx Reply with quote

I don't claim to be an expert, but I've had a lot of experience with the SIO board over the last several days.

apache37 wrote:
Can someone provide a small code snippet on how to test?


Sure, see the code and makefile below. My thanks to "tyranid" for sending the original code to me ;)
The makefile needs makefiles from PS2LIB (and hence the PS2LIB environment string needs to be defined)--I'm assuming you have PS2DEV setup on your system, right?

Haven't tried "ps2siotest.elf" with InLink, only with ps2client, but I suspect that it will work.

apache37 wrote:
I've used sio_getc() and seems to return just the same funky "y" character all the time.

A consistent "y" character sounds bad, but at least it is consistently bad. :-{

apache37 wrote:
I'm sure I'm just stupid.

Quote: Ignorance is curable, stupidity that's for life -- author unknown
(in case you're wondering this means you ain't stupid! ;) )

File: main.c

Code:
#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <iopheap.h>
#include <loadfile.h>
#include <iopcontrol.h>
#include <fileio.h>
#include <compat.h>
#include <sio.h>

// Macros
#define DEBUG

#ifdef DEBUG
#define dbgprintf(args...) printf(args)
#define dbgscr_printf(args...) scr_printf(args)
#else
#define dbgprintf(args...) do { } while(0)
#define dbgscr_printf(args...) do { } while(0)
#endif

int main(int argc, char *argv[])
{
  int ch;

  // Not sure if this is still necessary, but doesn't appear to be done by ps2lib's "crt0"
  sif_rpc_init(0);

  // Initialize screen display
  init_scr();

  scr_printf("SIO Communications Tester v1.0 [2004-09-20] by tyranid, modified by redcoat\n\n");

  for(;;) {
    ch = sio_getc();
    if(ch != -1) {
      sio_putc(ch);
      scr_printf("%c", (unsigned char)ch);
      dbgprintf("%c", (unsigned char)ch);
    }
  }

  return 0;
}


File: Makefile

Code:
######################################################################
# ps2siotest - Now uses the standard macros names from
#  Makefile.pref & Makefile.eeglobal (see dir. $PS2LIB)

# Customize the standard macro names used

EE_BIN = ps2siotest.elf
EE_OBJS = main.o


######################################################################
# Paths and flags
#

EE_ASFLAGS = -march=r5900 -EL

EE_CFLAGS = -march=r5900 -ffreestanding -fno-builtin -fshort-double -mno-memcpy \
   -nostartfiles -nodefaultlibs -mlong64 -mhard-float -mno-abicalls -EL

# Strip debug info., but leave some symbols
EE_LDFLAGS += $(LDPARAMS) -s

EE_LIBS = -lc -lgcc

######################################################################
#

all:   $(EE_BIN)

clean:
   rm -f $(EE_OBJS) $(EE_BIN)


include $(PS2LIB)/Makefile.pref
include $(PS2LIB)/Makefile.eeglobal
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group