|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
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
|
||||
|
||||
|
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 */
}
Thanks, Nathan |
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |