![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Tools | Display Modes |
|
|
#1 (permalink) |
|
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! |
|
|
|
|
|
#2 (permalink) |
|
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.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
|
|
#3 (permalink) |
|
Also look at Nigel Goodwin's RS232 tutorial for help.
|
|
|
|
|
|
#4 (permalink) |
|
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! |
|
|
|
|
|
#5 (permalink) | |
|
Quote:
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).
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
#6 (permalink) |
|
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 by Pavius; 12th January 2009 at 04:53 PM. |
|
|
|
|
|
#7 (permalink) | ||
|
Quote:
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. Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 12th January 2009 at 05:12 PM. |
|||
|
|
|
|
#9 (permalink) | |
|
Quote:
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 ... */
}
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 ... */
}
Last edited by Pavius; 12th January 2009 at 05:42 PM. |
||
|
|
|
|
#10 (permalink) |
|
I used tera term about 6 years ago and it felt very outdated back then (pre-windows 95 icons
|
|
|
|
|
|
#11 (permalink) | |
|
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
#12 (permalink) |
|
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: PC-Microcontroller Communications - Open Circuits |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Title | Starter | Forum | Replies | Latest |
| hyperterminal communication w/ 8051 | spyghost | Micro Controllers | 8 | 22nd May 2008 10:54 AM |
| Hyperterminal- Enter Key <CR> <LF> | dknguyen | Micro Controllers | 17 | 5th April 2008 01:38 PM |
| New to serial communication, Hyperterminal? | AceOfHearts | Micro Controllers | 26 | 8th December 2007 08:19 AM |
| rs232 communication with hyperterminal | dak246 | General Electronics Chat | 10 | 6th June 2005 09:50 AM |
| LCD display and Hyperterminal communication with 16F877 | peter83 | Micro Controllers | 2 | 16th May 2004 06:28 AM |