CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

sending serial data to 6 digit display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 18, 2007 1:49 pm     Reply with quote

It could be that the data is different, or it could be the inter-character
spacing that is different. (i.e., the time interval between transmission
of characters).

You need to capture the serial data and compare the characters
that are sent by the PIC or by VB6. You need a terminal program
that can display data in hex. Then you can see the control characters.

Or, to see the PIC's output, you can use sprintf() and then display
the buffer contents. The program below shows how to do this.
Here's the output:
Quote:

FE 03 31 32 33 34 35 36 FF 00 00 00 00 00 00 00 00 00 00 00


Code:

#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

//=======================
void main(void)
{
int8 buffer[20];
int8 i;

sprintf(buffer, "%c%c%s%c",254,3,"123456",255);

for(i = 0; i < sizeof(buffer); i++)
    printf("%X ", buffer[i]);

while(1);
}


If you can't get a terminal program that will display the VB6 data in hex,
then you could write a PIC program to read the VB6 output (from Com1)
and then send it to the PC as Ascii Hex bytes (as shown in the program
above).

To test if the problem is caused by inter-character spacing, you could
modify the PIC program to send one character at a time and put a
100 ms delay between each character, as it's sent to the 7-segment
display. (Use 100ms for an initial test).
tkidder



Joined: 19 Feb 2005
Posts: 11
Location: new york usa

View user's profile Send private message

tkidder
PostPosted: Sun Feb 18, 2007 4:59 pm     Reply with quote

Intercharacter delay necessary, needed a min of 5ms.

Many Thanks for help
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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