ts-7000
[Top] [All Lists]

[ts-7000] problem with custom pc/104 device

To:
Subject: [ts-7000] problem with custom pc/104 device
From: "Damian" <>
Date: Mon, 04 Jun 2012 13:29:35 -0000
Hello:

 I am using a TS-7260 WITH a  custom pc/104 has a FPGA,which offer 4 serial 
uart ports in which you have to set dinamically the I/O and IRQ for each port. 
Now, according to the board specifications this device contains a UART in which 
you set the BASE(0x300) with rotatory switches and  the IO  and IRQ 
dynamically. So lets say you set them to 0x300(BASE). This means at 0x300 you 
then need to write the upper Most Significant Bye (MSB) of the Serial port IO 
address and at 0x301 you need to write the Least Significant Byte (LSB) of the 
Serial Port IO address, like this:
0x300 0x03(msb)
0x301 0xf8(lsb)
0x302 0x06(irq=6 in board)

Now use mmap for doing this purpose. First I use the code below for configuring 
the custom pc104



   int fd;
   volatile unsigned int  *Msb,*Lsb,*Irq;
   unsigned int *pc104base;
   fd = open("/dev/mem", O_RDWR | O_SYNC);  //opening the com for communication
  if(fd < 0)
  {
   printf("Open do not return a sucessfull value\n");
   perror("fd :");
  }
   pc104base = mmap(0, getpagesize(),PROT_READ | PROT_WRITE, MAP_SHARED, fd, 
PC104_8BIT_IO_BASE);
     if (pc104base == MAP_FAILED)
     {
      printf("problem with mmap \n");
      perror ("pc104base");
      exit(1);
     }


  Msb = (unsigned int *)(pc104base + 0x00); //port b data
  Lsb = (unsigned int *)(pc104base + 0x01); //port b direction
  Irq = (unsigned int *)(pc104base + 0x02); //port c data
   
  *Msb = 0x03;
  *Lsb = 0xf8;
  *Irq = 0x06;
   printf("microbee mapped\n");
  close(fd);





Then I just open another char device for the communications purposes


printf("Starting to use the setserial\n");
 system("setserial  /dev/ttyTS0 port 0x11E00300 baud_base 9600 irq 33");
 // Com 1 is oppened with this function, it will control the acces to it in the 
program
 GpsCOM1 = open("/dev/ttyTS0", O_RDWR | O_SYNC);  //opening the com for 
communication
 if(GpsCOM1 < 0)
 {
 printf("Open do not return a sucessfull value\n");
 perror("GpsCOM1");
 }
 else
 {
  printf("starting to use the fucking GPS\n");

  printf("Executing code\n");
    SendCommand(interfacemode);
  printf("interfacemode passed\n");
  SendCommand(satvislog);
  check = GetSatVis();
}


All the above is performed sucessfully however the I cannot get any feedback of 
the attached GPS in the custom pc/104. It seems like no communication is 
established since the program stops indefinetily when waiting for the GPS data.

Sorry for the long email, but I do not want to lose any details.thanks
Damian



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU