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 support@ccsinfo.com

How to check if RCV port receives expecting signal?

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



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

How to check if RCV port receives expecting signal?
PostPosted: Thu Aug 05, 2004 2:07 pm     Reply with quote

I developed a GUI using vc++ to send char data to com port, but I could not get the expecting event, for example, I send 'a' to the chip, the chip will check if it is 'a' if it is 'a' send something back. I was being able to see the expected result by using hyperterminal, but I could not see result by my GUI. I need to find out what is send from my GUI.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 05, 2004 5:29 pm     Reply with quote

Sounds like your GUI doesn't work!
Guest








PostPosted: Fri Aug 06, 2004 6:08 am     Reply with quote

I did receive correct data from the chip, just sending!
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 6:17 am     Reply with quote

Well if Hyperterminal receives it correctly, then the chip must be sending it correctly.
Guest








PostPosted: Fri Aug 06, 2004 6:46 am     Reply with quote

Yes, the chip receive and send correct right, there is no problem with the chip, in the hyperterminal, when I hit 'a' the return letter is 'b' everything works fine.

Code:

#if defined(__PCM__)
#include <12f675.h>
#fuses INTRC_IO,NOWDT,NOPROTECT,PUT,NOMCLR
#use delay(clock=4000000)
#use rs232(baud=9600, parity=N, xmit=PIN_A5, RCV=PIN_A3)

void produce_pwm(int8 duty);

void main()
{
  setup_comparator(NC_NC_NC_NC);
  while(1) {
  putc(getc()+1);
  output_high(PIN_A0);
  }
}


In my GUI, I click a button, the button start a event to sent data 'a' to co mm, but nothing happened.

my button function is

Code:

void CSerialView::OnBnClickedStart()
{
COleVariant var(_T("a"));
m_comm.put_Output(var);
}


what is wrong with it?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 06, 2004 7:03 am     Reply with quote

Have no idea. This is a CCS forum. I would suggest looking on the NET for some examples of sending serial data using Visual C.
Ttelmah
Guest







PostPosted: Fri Aug 06, 2004 7:09 am     Reply with quote

Anonymous wrote:
Yes, the chip receive and send correct right, there is no problem with the chip, in the hyperterminal, when I hit 'a' the return letter is 'b' everything works fine.

Code:

#if defined(__PCM__)
#include <12f675.h>
#fuses INTRC_IO,NOWDT,NOPROTECT,PUT,NOMCLR
#use delay(clock=4000000)
#use rs232(baud=9600, parity=N, xmit=PIN_A5, RCV=PIN_A3)

void produce_pwm(int8 duty);

void main()
{
  setup_comparator(NC_NC_NC_NC);
  while(1) {
  putc(getc()+1);
  output_high(PIN_A0);
  }
}


In my GUI, I click a button, the button start a event to sent data 'a' to co mm, but nothing happened.

my button function is

Code:

void CSerialView::OnBnClickedStart()
{
COleVariant var(_T("a"));
m_comm.put_Output(var);
}


what is wrong with it?

Realistically, the 'odds' are that it is something like the baud rate not being setup correctly for the com control (remember this is seperate from the settings used by hyperterminal). Assuming you have a second com port on the machine, make a 'crossover' cable, that takes the transmit output from your program, and routes it to the input pin on the other port. Setup hyperterm to look at the other port, and you will see if anything is sent. You will then be able to see if it is a failure to send, or perhaps a baud rate setting. If it is a failure to send, then look at the 'hanshaking' settings for the com control. If these are on and set to 'hardware', the port won't send without seeing a 'ready' signal. An RS232 'breakout' box, will give the ability to see what the signals are doing, if it is available.

Best Wishes
Guest








PostPosted: Fri Aug 06, 2004 7:20 am     Reply with quote

Thank you, I solved it. The problem with my program is that I have to function relative to the button, and one is default, that one does not have send data function, so, it does not work.
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