Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Dashboard Port Decoder (http://www.chiefdelphi.com/forums/showthread.php?t=44830)

whytheheckme 02-03-2006 00:17

Re: Dashboard Port Decoder
 
If I had a 2003 OI hooked to the 2003 FRC, could I still have data in from the 2006 dashboard port? Wouldn't the OI be taking the tether port which is where i would have data coming in? Could I take the data from the dashboard port on the 2006 OI and send it to a digital input on the 2003 FRC? Why does the 2003 FRC require a OI if I am using the other data as an "OI"? I guess I am just clinging on to hopeless thoughts here. I am probably going to have to get an EDU-BOT PIC controller. If I got one, how would I interface the data from the dashboard port in C (there is no SERIN in C, at least not that I know of.)

Jacob Komar

Revised Comments:
I guess I overlooked part of your previous post. If I used a previous years FRC, that would be all that I need. How would I specify what I want the input to be on the serial port though, if I'm programming it in C? That would be easy in PBASIC, because I could specify it using SERIN. I am not greatly familiar with C, so maybe there is a way to port the bytes to variables.

Rickertsen2 02-03-2006 17:15

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
If I had a 2003 OI hooked to the 2003 FRC, could I still have data in from the 2006 dashboard port? Wouldn't the OI be taking the tether port which is where i would have data coming in?

You would have the data from the dashboard port coming into the "program" port. There are a number of reasons you can't hook the data from the dashboard port into the "tether" port.

Quote:

Originally Posted by whytheheckme
Could I take the data from the dashboard port on the 2006 OI and send it to a digital input on the 2003 FRC?

No. If the pins were directly connected to the user processor, you could do this. They are not. They are connected to the master processor which this relays this info the the user processor. This happens far too slowly to be able to read the data stream. Also the signal coming out of the dashboard port is RS232. It uses -10v to signal a 1 and +10v to signal a 0. You would have to convert this to a TTL level signal (0/5v)

Quote:

Why does the 2003 FRC require a OI if I am using the other data as an "OI"?
the 2003 OIs are incompatible with the new OIs. This would also not be competition legal. There are other complications too.

Quote:

I am probably going to have to get an EDU-BOT PIC controller. If I got one, how would I interface the data from the dashboard port in C (there is no SERIN in C, at least not that I know of.)
I think this is your best option. Things in C are a bit more complicated. Ther learning curve is streep, but once you learn it you would never go back to basic. The people around these forums can help you out with the code.

whytheheckme 02-03-2006 17:23

Re: Dashboard Port Decoder
 
If I use the program port to the dashboard port, could I have two SERIN commands? Also, the computer does not have enough storage for 2*26 varible bytes.

Jacob Komar

Rickertsen2 02-03-2006 17:26

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
If I use the program port to the dashboard port, could I have two SERIN commands? Also, the computer does not have enough storage for 2*26 varible bytes.

Jacob Komar

yes you can...... sad sad basic stamp.....

whytheheckme 02-03-2006 17:28

Re: Dashboard Port Decoder
 
Would my input in the SERIN command be 1/0 instead of COMA/COMB?

When I do this, I get the Basic Run Err on the OI.

Jacob Komar

Rickertsen2 02-03-2006 17:30

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
Would my input in the SERIN command be 1/0 instead of COMA/COMB?

When I do this, I get the Basic Run Err on the OI.

Jacob Komar

Sorry but i havn't done pBASIC in a long time. If you post your code, i will dig our the pBASIC manual and have a look at it when i get home. Also, how do you have things connected.

basic run error means your code is getting stuck.

whytheheckme 02-03-2006 17:35

Re: Dashboard Port Decoder
 
1 Attachment(s)
Here is the BASIC code. I added the SERIN after the one that is already there. I have the dashboard port hooked to the Program port via a null modem cable. I have also tried it with a direct serial. The null gives me basic run err and the direct gives me basic init err.

Thank you,
Jacob Komar

I attached the file. get rid of the .txt to get the bsx.

Rickertsen2 02-03-2006 19:00

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
Here is the BASIC code. I added the SERIN after the one that is already there. I have the dashboard port hooked to the Program port via a null modem cable. I have also tried it with a direct serial. The null gives me basic run err and the direct gives me basic init err.

Thank you,
Jacob Komar

I attached the file. get rid of the .txt to get the bsx.

The problem is that in your second serin, you are reading from the wrong pin (should be 16 not 1/0), at the wrong baud rate.

the line should read
Serin 16, 110, [oi_sw...

Pin 16 is connected to the input pin of the program port. You need to use a baud rate of 19,200. 110 instructs a baud of 19,200 (as calculated from the formula in the basic stamp manual). This might not work. The datasheet strongly cautions against using a baud higher that 4800 or the stamp might not be able to keep up.

whytheheckme 02-03-2006 19:21

Re: Dashboard Port Decoder
 
After changing the code, I still get the Basic Run Err light. I tried disabling the Serin COMA/COMB and it still sees the operator interface and runs without it. I still get the Basic Run Err though. I also tried toning the Baud rate down.

Jacob Komar

Revised Comments:
If I remove ALL of the serin commands, I also get the Basic Run Err. Could this mean that it doesn't see the serin 16 as a valid command?

Rickertsen2 02-03-2006 19:41

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
After changing the code, I still get the Basic Run Err light. I tried disabling the Serin COMA/COMB and it still sees the operator interface and runs without it. I still get the Basic Run Err though. I also tried toning the Baud rate down.

Jacob Komar

Revised Comments:
If I remove ALL of the serin commands, I also get the Basic Run Err. Could this mean that it doesn't see the serin 16 as a valid command?

You are probably having the problem of trying to receive data faster than the stamp can handle. There is no way around this. I am pretty sure that 16 is right but there is a chance i could be wrong. It has been a long time since i have dealt with the old controllers of basic stamps at all.

BTW: you cannot "tone down" the baud rate or the communication will become totally corrupted. You will be listening at a different rate than data is being sent by the dashboard.

Also it is essentially receiving "BS" data. Data from the dashboard port is not in the format that is expected. This may be causing some later piece of code to screw up.

whytheheckme 02-03-2006 19:44

Re: Dashboard Port Decoder
 
I removed all of the code afterward, so it's not hanging up there. Even if the baud rate is wrong, shouldn't it still try to recieve data? If I unplug the dashboard cable going to the program port, it still gives me the error. Should it do this? Where can I find out about that port 16 thing?

Jacob Komar

Rickertsen2 02-03-2006 20:04

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
I removed all of the code afterward, so it's not hanging up there. Even if the baud rate is wrong, shouldn't it still try to recieve data? If I unplug the dashboard cable going to the program port, it still gives me the error. Should it do this? Where can I find out about that port 16 thing?

Jacob Komar

the port 16 thing is mentioned in the serin section of the basic stamp manual. 16 is a special number that actually means pin 2 which is the pin used for programming the stamp. This should be the one connected to the "program" port. The manual is vague, but apparently 16 also offers some sort of enhanced hardware support for receiving serial data.

whytheheckme 02-03-2006 20:14

Re: Dashboard Port Decoder
 
I just obtained a VEX computer, which has a com port adapter and digital I/Os. It can be programmed in C. What C code would I use to interpret the data stream from the dashboard port through the built in com connector thingy?

Jacob Komar

Rickertsen2 02-03-2006 22:54

Re: Dashboard Port Decoder
 
Quote:

Originally Posted by whytheheckme
I just obtained a VEX computer, which has a com port adapter and digital I/Os. It can be programmed in C. What C code would I use to interpret the data stream from the dashboard port through the built in com connector thingy?

Jacob Komar

I have never messed with a vex controller and don't much of anything about them.


-------------- edit ---------------
I downloaded the default VEX code and documentation. The VEX controller looks to be almost identical to the EDU and full size RC. This is a good thing. I will give you some example code sometime tomorrow.

whytheheckme 03-03-2006 07:31

Re: Dashboard Port Decoder
 
That would be great. I was sucessfully able to download to the computer using the IFI loader, so now its just a matter of writing the code. If you could give me some sample input code, that would be great.


Jacob Komar


All times are GMT -5. The time now is 05:18.

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