![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
msilvar
Joined: 06 Jan 2011 Posts: 2 Location: CHILE
|
Help with fprintf and STDOUT |
Posted: Thu Jan 06, 2011 8:08 pm |
|
|
Hello,
I'm working in a code that uses two USART, one in SW and the another in HW. Everything was going smooth until the last build returned an error:
Quote: |
*** Error 132 "C:\Microchip Solutions\Lauca Eth\A08001000MU\Main_C.c" Line 319(21,22): STDOUT not defined (may be missing #USE RS232) ::
1 Errors, 0 Warnings. |
I'm looking if I make a mistake but my code is in the same state that the last debug session with the ports working. The #use rs232 are there and have this syntax:
Code: |
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=Lauca,errors)
#use rs232(baud=9600,parity=N,xmit=PIN_B1,rcv=PIN_B0,bits=8,stream=RS485,errors) |
Is this a failure of my IDE software (MPLAB & CCS) or there could be anything else?
Here are the main portions of my code:
Code: |
//**********************
#OPT 9
#include <16F883.h>
#device *=16
#device adc=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES PUT //Power Up Timer
#FUSES NOMCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No Reset when brownout detected
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOLVP //No low voltage prgming
#FUSES NODEBUG //No Debug mode for ICD
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=Lauca,errors)
#use rs232(baud=9600,parity=N,xmit=PIN_B1,rcv=PIN_B0,bits=8,stream=RS485,errors)
#use FAST_IO(C)
#use FAST_IO(B)
#use FAST_IO(A)
//****************************************************************
//Headers
#include <string.h>
#include <stdlib.h>
#include <A08.h>
....
void TXUsart()
{
disable_interrupts(INT_RDA);
fprintf(Lauca,"Hello"); //Test
fputc(0x0A,Lauca);
fputc(0x0D,Lauca);
fputc(Trama_comm.NodoID[0],Lauca);
fputc(Trama_comm.Comando[0],Lauca);
fputc(Trama_comm.Puerto[0],Lauca);
fputc(Trama_comm.DatoRCVL[0],Lauca);
fputc(Trama_comm.DatoRCVH[0],Lauca);
fputc(0x0A,Lauca);
fputc(0x0D,Lauca);
clear_interrupt(INT_RDA);
disable_interrupts(INT_RDA);
} |
Any help will be useful.
Thanks in advance |
|
![](templates/subSilver/images/spacer.gif) |
msilvar
Joined: 06 Jan 2011 Posts: 2 Location: CHILE
|
|
Posted: Thu Jan 06, 2011 8:20 pm |
|
|
Hey folks, I found the issue.
In a header I have defined three vars as follows:
Code: |
//****************************************************************
//Port Mapping, Addresses and Commands
//#define Lauca 0x00 //Lauca Address
//#define HMI 0x0A //HMI Address
//#define A08 0xFF //A08 Address
#define ReadPort 1u //Read Port
#define ReadData 2u //Read Data
#define ReadStat 3u //Read Status
#define ReadConf 4u //Read Config
|
I've commented the first three and everything was solved. But the doubt is still there. Whats happened? What was my mistake? (I'm sorry if my question is idiot, but I'm not clear with what was the mistake). |
|
![](templates/subSilver/images/spacer.gif) |
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jan 06, 2011 9:31 pm |
|
|
You can't have a stream name with the same name as something else - this came up recently, but I don't remember the exact context. (in this case, you named the stream "Lauca" but also had a #define for it as 0x00
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|