Go to Post I wish my biology class was this exciting. - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 05-02-2007, 10:09
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Mixing WPILib with default MPLAB code

Quote:
Originally Posted by michael714 View Post
Dear Brad,
I've been trying to do it myself. I added the 2k5 files including API.h, UserAPI.h, and WPILIb2k5.lib to Kevin Watson's edu_camera code and the compiler was able to do everything with no errors or warnings except from the Linker at the end and it looked like this:

Error - section 'InterruptVectorLow' type is non-overlay and absolute but occurs in more than one input file.
Yeah, that's the crux of the problem. You are seeing that the default code and WPILib each want to control the interrupt vectors. It's pretty easy to write some code that tracks the green target using WPILib, but I think it would be some work to modify Kevin's project to be compatible. You would probably want to use the WPILib camera driver and have it deliver t-packets to his higher level code. It's kind of like trying to run LINUX and Windows on the same computer.

If you are interested in trying to port the code, I'd be happy to help in any way that I can.

WPILib (and easyC) have a different philosophy of device support from the default code, and Kevin's work is based on the default code. In WPILib all the interrupt handling and timing are handled from a single kernel much like an operating system. When other devices want to get interrupt support, either interrupt pins, serial ports, or timers, they just make calls to the kernel to register their "interest". Then when the interrupts happen, the kernal calls the interrupt service routines in the device driver. The reason it works this way is that the device drivers are completely independent of each other. So you could write your own camera driver while leaving everything else unchanged and you wouldn't have to change your application at all.

The default code doesn't work this way - it's a monolithic application that runs on the hardware. To add devices, changes mut be made to quite a few files, rather than just installing a new driver.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #17   Spotlight this post!  
Unread 24-10-2007, 10:45
Peter Randall Peter Randall is offline
Director of Technology
FRC #1218 (Vulcan Robotics)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Philadelphia
Posts: 37
Peter Randall will become famous soon enoughPeter Randall will become famous soon enough
Re: Welcome to the WPILib forum

Brad,

I have a student who is trying to add a Parallax GPS to an FRC projectin Easy C. We are having difficulty understanding how to read and write to the TTL serial port. Can you provide guidance on how to do this?

Thanks

PGR
__________________
Peter Randall
Chairman, Department of Engineering & Robotics
Springside Chestnut Hill Academy
TEAM 1218
  #18   Spotlight this post!  
Unread 27-11-2007, 23:11
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Welcome to the WPILib forum

We want to read the serial port with EasyC also. I think WPILIB functions can be called directly in EasyC, not just with the icon blocks supplied, using a User Code block ... that is yet to be confirmed.

Page 46 of the WPILIB manual (9 January 2007 version) covers the Serial Port functions OpenSerialPortOne(), ReadSerialPortOne(), WriteSerialPortOne().

If I find out how to do this, I'll post here.

mike
  #19   Spotlight this post!  
Unread 30-11-2007, 09:12
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Welcome to the WPILib forum

Simplicity itself - I just used:

unsigned char inchar;

inchar = ReadSerialPortOne();

if (inchar != 0)
{
// valid character is available
}

No need to open the port (#1) as the FRC runtime environment had already opened it at 115200 baud.

For output to the port use the standard EasyC print block.
  #20   Spotlight this post!  
Unread 03-12-2007, 19:39
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Welcome to the WPILib forum

WPILib is an amazing contribution. My team is working on creating code based almost entirely on WPILib and a few extra #defines, due to its simplicity. This makes the code easy to debug and extremely fast to write. I'm surprised more people aren't using this.
__________________
  #21   Spotlight this post!  
Unread 12-02-2008, 11:12
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Welcome to the WPILib forum

I noticed what I thought was a bug last year in serial_ports.h and its changed slightly this year but is still there?

The following is an except from a .map file from MPLAB when using WPILIB. It appears rx2Framing_Errors is defined as static storage within serial_ports.h rather than as an extern so every inclusion of this file allocates new storage for this variable. It may be that this is not shared across files, but the rx1 equivalent variables are only defined once in serial_ports.c. A similar set of variables are defined for rx2 in serial_ports.c... but then serial_ports.h defines possibly the same variable but with an underscore.

The results appears that just some extra storage is allocated but never used. Since these appear to be static defines in serial_ports.c, I wonder if there is any need at all for them in serial_ports.h.

Anyway, just an observation.

Code:
         rx1FramingErrors   0x0005b6       data     static C:\..\serial_ports.c
         rx1OverrunErrors   0x0005b4       data     static C:\..\serial_ports.c

       rx2FramingErrors   0x0005b7       data     static C:\..\serial_ports.c
        rx2Framing_Errors   0x000300       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x00061a       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x0005d1       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x0004fd       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x000638       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x0004eb       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x000622       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x0002cb       data     static C:\..serial_ports.h
        rx2Framing_Errors   0x000609       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x0003b2       data     static C:\..\serial_ports.h
        rx2Framing_Errors   0x000636       data     static C:\..\serial_ports.h

         rx2OverrunErrors   0x0005b5       data     static C:\..\serial_ports.c
        rx2Overrun_Errors   0x0004ec       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x000301       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x0005d2       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x00061b       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x0004fe       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x000639       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x00060a       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x000623       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x0003b3       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x000637       data     static C:\..\serial_ports.h
        rx2Overrun_Errors   0x0002cc       data     static C:\..\serial_ports.h
  #22   Spotlight this post!  
Unread 24-03-2008, 21:01
starsROBOTICS starsROBOTICS is offline
Registered User
FRC #2276 (S.T.A.R.S)
Team Role: Engineer
 
Join Date: Mar 2008
Rookie Year: 2006
Location: texas, houston
Posts: 44
starsROBOTICS is on a distinguished road
Re: Welcome to the WPILib forum

is there a way to program another camera instead of using the cmu cam?
  #23   Spotlight this post!  
Unread 25-03-2008, 22:44
starsROBOTICS starsROBOTICS is offline
Registered User
FRC #2276 (S.T.A.R.S)
Team Role: Engineer
 
Join Date: Mar 2008
Rookie Year: 2006
Location: texas, houston
Posts: 44
starsROBOTICS is on a distinguished road
Re: Welcome to the WPILib forum

how does wpilib and easyc differ? which ones better?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
National Instruments LabVIEW and Data Acquisition Forum Danny Diaz National Instruments LabVIEW and Data Acquisition 1 16-01-2006 13:20
moderators for Q&A forum Ken Leung CD Forum Support 25 03-01-2003 18:15


All times are GMT -5. The time now is 10:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi