![]() |
New Robot Controller Serial Port Driver
I've written a proper serial port driver from scratch that can be downloaded here: http://kevin.org/frc. The main source file, serial_ports.c, consists of just over a thousand lines of code, comments and documentation. The code implements a fully buffered, full duplex, interrupt driven serial port driver for the FRC and EDU robot controllers. I've included the readme.txt text below. Have fun.
Edit: This project was built using MPLAB 6.60. If your version of MPLAB complains about the project version, the best thing to do is just create a new project with MPLAB's project wizard. Include every file except: FRC_alltimers.lib, ifi_alltimers.lib, printf_lib.c and printf_lib.h and you should be able to build the code. -Kevin Code:
The source code in serial_ports.c/.h contains a software |
Re: New Serial Port Driver
Kevin, this sounds AWESOME!
I downloaded the zip and extracted it. Then, I tried to open up the project file and I got the error: Unable to load the project because the format of the project file has been changed. The project immeditaely gets closed. Any ideas? |
Re: New Serial Port Driver
Quote:
-Kevin |
Re: New Serial Port Driver
Good GOD! I was just wishing such a thing existed this morning and SHAZZAM, Watson does it again.
|
Re: New Serial Port Driver
Just an idea... you could add a definition to disable the second serial port... so that way if someone doesn't use the second one, you can just define DISABLE_PORT_TWO and it wouldn't try to compile that section using conditional statements...
Code looks like a good idea though... nice :) |
Re: New Serial Port Driver
Quote:
-Kevin |
Re: New Serial Port Driver
1 Attachment(s)
Quote:
|
Re: New Serial Port Driver
Quote:
Feel free to use my code for your own use. I do, however, ask that people please not modify my code and make it available elsewhere on the web. I ask this for two major reasons: (1) As code gets updated, I need to have one source for that code on the web so that there will be no question of its "freshness" or validity. (2) Time permitting, I'm happy to answer questions about my code (that's why I include my e-mail address in the header), but as I'm the sole support person for my code, and I have a family and a day gig, I'd rather not have to deal with questions regarding code that's been modified by others. Yes, I'm a knuckle-head for not spelling this out in the readme.txt. I'll also look into adding the functionality you've requested, but make it more general. Something like #define USE_SERIAL_PORT_ONE, etc... Thanks, Kevin |
Re: New Serial Port Driver
Kevin, this is awesome... great work. I'd really like to implement your code to drive an LCD for debugging and diagnostics on our robot this year, so I'll let you know if/when we do. Thanks for your contributions to the community... not just this code, but all of the stuff you've writted for us. :)
|
Re: New Serial Port Driver
Quote:
-Kevin |
Re: New Serial Port Driver
I have just posted the following on the Spark Fun Electronics Technical Forum... I am posting here as well in case one of you have seen this problem.
Quote:
I will post here if I get good feedback from the SFE site. |
Re: New Robot Controller Serial Port Driver
I was under the impression that the "usart" files included with the compiler provide serial port functions. Can someone tell me the difference?
|
Re: New Serial Port Driver
Quote:
-Kevin |
Re: New Serial Port Driver
Quote:
Thanks for your reply... I dusted off my Visual Studio and compiled the Visual Basic program VBTerm.vbp (from the MSDN library). Ran VBTerm and can get into the SMiRFv2 config... So far, so good... I haven't got the pair to recognize each other yet ("Remote Configuration Change Failed!"), I'm making progress... [EDIT] Update: Everything is working fine now that Hyperterminal is not in the loop. Thanks again.[/EDIT] Thanks for your help. |
Re: New Serial Port Driver
Sorry for a Stupid question;
I have added the printf.c/.h and the serial.c/.h (or whatever its called) to last years code. I added the following line to my user_routines (we call ours user_routine_1): printf("hello world"); and got a syntax error. then I added: stdout = TWO; printf("hello world"); and still got a syntax error, but on the printf line, not the stdout line. Help |
| All times are GMT -5. The time now is 23:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi