Go to Post Last I looked, FIRST wasn't an acronym for inspiration and recognition of robots. It was and is an acronym for inspiration and recognition of science and technology. - JaneYoung [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2008, 00:25
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Serial_Write_Char() - Question

Hi,

When using the "Serial_Write_Char()" function I know the correct syntax is "int port,int ch_out."

However when I use "Serial_Write_Char(TTL_PORT,52);" the "Program State" LED stays orange. What am I doing wrong?

Thanks,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #2   Spotlight this post!  
Unread 08-02-2008, 12:58
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: Serial_Write_Char() - Question

Running IFI default code? Called Serial_Driver_Initialize() before hand? Did anyone modify the IFI default low interrupt handler and remove CheckUartInts() call?

A random guess is the interrupt flag is being set but never cleared.
  #3   Spotlight this post!  
Unread 08-02-2008, 14:11
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Re: Serial_Write_Char() - Question

This is the end part of "User_Initialization" in user_routines.c

Code:
  relay7_fwd = 1;
  relay7_rev = 0;

  Initialize_Falcon();
 
  Putdata(&txdata);             /* DO NOT CHANGE! */

  Serial_Driver_Initialize();

  printf("IFI 2006 User Processor Initialized ...\r");  /* Optional - Print initialization message. */

  User_Proc_Is_Ready();         /* DO NOT CHANGE! - last line of User_Initialization */
}
The "Initialize_Falcon()" is where I try to write to the TTL port. As you can see it IS above "Serial_Driver_Initialize()," but I can't move it down because the it would be below Putdata?

Thanks,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #4   Spotlight this post!  
Unread 08-02-2008, 14:54
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: Serial_Write_Char() - Question

I'm not sure I see the problem of moving it down. But if you can't, you can't (not sure why as IFI initialization has already done two Putdata() calls to init both low level buffers). Try the following..


Code:
 
  relay7_fwd = 1;
  relay7_rev = 0;


 
  Putdata(&txdata);             /* DO NOT CHANGE! */

  Serial_Driver_Initialize();
  Initialize_Falcon();
  statusflag.TX_UPDATED = 0;    /*reset these to update latest data later*/
  Putdata(&txdata);                  /*put data out again */

  printf("IFI 2006 User Processor Initialized ...\r");  /* Optional - Print initialization message. */

  User_Proc_Is_Ready();         /* DO NOT CHANGE! - last line of User_Initialization */
}
  #5   Spotlight this post!  
Unread 08-02-2008, 15:04
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Serial_Write_Char() - Question

I don't see why you shouldn't be able to move the Initialize_Falcon down, but you can definitely move the serial initialize up. In any case, you have to call the initializer before you can use the serial ports.
  #6   Spotlight this post!  
Unread 08-02-2008, 16:13
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Re: Serial_Write_Char() - Question

Ok, so I actually ended up moving my initialization function to process_Data_From_Master_uP() and just making sure it only gets called once.

It works now :-)

Thanks,
nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
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
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33


All times are GMT -5. The time now is 19:08.

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