Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC and Hyperterminal Communication

Status
Not open for further replies.

00morrisd

New Member
Hello All,

I would like some advice on how I can get my Hyperterminal program to display a worded message from a bit stream sent by my PIC16F88.

My current project is set up as follows:-

My PIC16F88 recieves three '1' or '0' inputs from a set of switches (these switches are simulating another PICs outputs).

In my code (help also needed), I assign worded messages to each combination of 1s and 0s. E.g. Recieve 101, Send message "FAIL".

This message, in binary, is then sent through one pin of the PIC, through a MAX232 converter and into my PC via a serial port.

I do not need to send data to the PIC, just need to display a message related to the input from the switches.

So, my main question is this......

Can this be done the way I have explained it? And if I assign all letters in my message with the correct ASCII code and choose the ASCII selection in Hyperterminal, will my message, e.g. "FAIL", appear on my monitor?

Any help is greatly appreciated, keep up the good work!
 
Can this be done the way I have explained it? And if I assign all letters in my message with the correct ASCII code and choose the ASCII selection in Hyperterminal, will my message, e.g. "FAIL", appear on my monitor?
Yes it can be done. It's pretty easy too. Look at Chapter 11.0 in the datasheet. You'll need to study right from the start of the chapter, but the steps you'll need to follow to set up and transmit are on Page 103.
 
Thanks Guys,

Which language / programs do you think I need to use to write the code. I am settled on using Hyperterminal and PICSTART to download the program but apart from that I can use pretty much anything else.

Please bare in mind though that I am completely useless at all Programming and I have been asked to use C++ if possible.

Any examples of code would be great so I can see what a finished product would look like!
 
Which language / programs do you think I need to use to write the code. I am settled on using Hyperterminal and PICSTART to download the program but apart from that I can use pretty much anything else.

Please bare in mind though that I am completely useless at all Programming and I have been asked to use C++ if possible.

Any examples of code would be great so I can see what a finished product would look like!
Use any language you like. Assembly language is fine, or the higher level language of your choice. You won't likely be using C++, as it isn't really suited to microcontroller use. But C is no problem. I prefer BoostC, but there are several others. They're all pretty good.

Poke around on my site and you'll find some RS232 code you could adapt (or, as suggested, look at Nigel's tutorials). I don't know if it's for 16F88, but the PIC UARTs are so similar that it would probably work on almost any PIC (with minor changes).
 
Not to start a holy war, but i don't understand why anyone would use a non ANSI C compiler (such as BoostC). If you're starting a commercial product, your code may be around for 5, 10 or even 15 years. Is the BoostC compiler going to be around that long? You're pretty much binding your project's fate to that of the proprietary compiler. To make a long rant short - i recommend using pure ANSI C (even refraining from using the 0b0010010 binary format specifier). I love C++ (it's what i use when i write code for the 32 bit processors) but would never think of using it for an 8 bit. I doubt there is a compiler for it as well. Remember that most you can do in C++ (besides templates) can be done in C - write object oriented code! It's a theory, not a syntax.

As for hyperterminal - this is the lowest you can get in terms of a serial program. It might seem to suite your needs (it does) but it's just awful. You're better off using something free like putty or shelling out for CRT (which has been deprecated for SecureCRT) - hands down the best serial terminal i know.

Edit: I doubted it, but BoostC++ exists for PIC16. Nice.
 
Last edited:
Not to start a holy war, but i don't understand why anyone would use a non ANSI C compiler (such as BoostC). If you're starting a commercial product, your code may be around for 5, 10 or even 15 years. Is the BoostC compiler going to be around that long? You're pretty much binding your project's fate to that of the proprietary compiler. To make a long rant short - i recommend using pure ANSI C (even refraining from using the 0b0010010 binary format specifier).
BoostC is ANSI compatible.

EDIT: I'd be willing to bet that the OP's project is a school assignment. Not likely the code will be around in 5 years. :p

As for hyperterminal - this is the lowest you can get in terms of a serial program. It might seem to suite your needs (it does) but it's just awful.
Ya it kinda sucks. But it's always there (in XP) and works ok usually. I use Tera Term Pro.
 
Last edited:
Uggh! Just say no to Object Oriented Programming for microcontrollers.

:mad:

Bad, non-object oriented, C code:

Code:
/* get temperature */
signed char temp_read()
{
   /* do read */
   i2c_read(SOME_DEVICE_ADDRESS_DEFINED_IN_HEADER, ...);

   /* error handling and return result ... */

}

Good, object oriented, C code:

Code:
/* get temperature from sensor previously initialized with temp_init() */
signed char temp_read(handle temp_sensor)
{
   /* cast handle (which is a typedef'ed void *) to info structure */
   temp_sensor_info = (temp_sensor_info_t *)temp_sensor;

   /* do read */
   i2c_read(temp_sensor_info->i2c_address, ...);

   /* error handling and return result ... */
}

So simple, very little overhead yet so much more flexible.
 
Last edited:
I used tera term about 6 years ago and it felt very outdated back then (pre-windows 95 icons :)). I just checked and saw that it hasn't been updated since. I highly recommend CRT/SecureCRT - it just does what a terminal should do (sounds trivial but as you probably know - very rare).
Ya, it is very old fashioned. But it does exactly what I need and I like it.
 
Not Hyper Terminal but...

Hyper terminal is for programmers in hell.

Some alternatives:

BoostC has a built in terminal window ( took me 2 months to notice it )
Some bootloaders have built in terminals ( google around, i forget witch
"screamer" or something similar is one that may be right.
Free Software for rs485 rs422 rs232 serial Communications has a nice free term. emul.

and there is a list at:

**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top