pbp list 4 commands
hserin hserout
hserin2 hserout2
would like to know how these pins are labled on the pic
apparently you do not use pin numbers with this command
pbp list 4 commands
hserin hserout
hserin2 hserout2
would like to know how these pins are labled on the pic
apparently you do not use pin numbers with this command
read the manual lots of info to digest maybe i missed it
but only reference to pin # says to look at the pic documentation
thats fine but how are the labled?
does the 16f877a have these wre this something on newer pics
when i purchased pbp it was because it was simple to use and did not require
master in programming or microchip documentation or much assembly
that has not been the case with what i have done so for
read the pic manual pg 113 which talks about this
all i wanted was a description of how the pins for this were labled
so i coulkd test this part of the pbp manual
guess i am over my head again do not see descriptors
i know there are pin liabled rx and tx but these are being used to connect to mcs
I was just trying to learn you something so you could figure other stuff out in the future...
HSERIN = receiving serial data = USART receiver = RX
HSEROUT = transmitting serial data = USART transmitter = TX
If the RX and TX on your particular chip in your particular system are already being used by something else, such as the MCS (which is what?), then you probably can't use HSERIN/HSEROUT without circuit mod's.
i know and i appreicate that however just at the begining stage and only a hobby
so just trying to get some experience with pbp not pics
mcs is microstudio plus
does this pic have hserout2???
i guess my main problem is i am trying to get data to a serial lcd driver
and cant get it to work even though there seems to be data from the pic
thats why i wanterd to try the various commands for serout to get this working this seems to be a tough area for me
thanks
Questions for Jack:
Why do you want to use HSERIN, HSEROUT? Do you know why they are not Serin and Serout? Or HSERIN2? HSEROUT 2?The masked man wants you to know those things that is why he keeps pushing the manual to you. See then you can ask questions which makes everyone's brain hurt, that is why we all do this, it's for the pain![]()
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
no pain no gain
the problem is i am unable to get a serial lcd driver to function
tried many many different things still nothing
thought different commands would inprove nothing seems to work
even though i am getting something (scope) out of the pic
tried all the serial commands and different bauds ebven thought the device states 9600 8 n 1
device did work using basic stamp instructions
Why not post your schematic and some of your code so that we can be more help. Just telling us that you have tried lots of different things with no success doesn't give anyone a starting point to help you.
It's not a basic stamp, while a stamp is a pic. HUH? WHATS THAT?
PBP will program a stamp, but pics not always the same, little differences.
Hserin will not accept N9600, has to be true.
Serin wil accept N9600. Hserin will accept charactors incomming while pic is busy running subroutines, serin will not. Do a search for serial backpacks on this forum, this subject has been addressed. look at the code in my post on this subject after Darrel did his magic on it. It's sweet, uses hserin, DT instant interrupts and formats the same way as LCDOUT does. It is pretty well commented so you can learn how it works and change it to suit you.
if you just want a serial in parallel out
try
JSCode:include "modedefs.bas" pause 500 char var byte Lcdout $fe, 1, "RTFM" pause 1000 LOOP: serin Portb.0, n9600, char LCDOUT char goto loop
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
HSERIN & HSEROUT automatically use the PIC's hardware USART pins. Which pins these are can be found in your datasheet.
Most serial LCD's require inverted data format. The hardware USART uses non-inverted, since data will normally pass through a MAX232 level converter.
If you use the hardware USART to communicate with your serial LCD, and your LCD requires inverted data, then, with HSEROUT, you'll need a TTL level converter, or use one of the other serial commands like SEROUT, SEROUT2, or DEBUG.
These commands allow you to control whether the data is inverted or non-inverted, and use just about any I/O-pin. HSEROUT does not.
still not getting a display using any of the pbp
serial out commands tried all 4 copied some programs still nothing even though the pic seems tp be transmitting something
hook up is straight foward 5- volt ,grd, and one pic pin for data out
tried many pins
using a 16f877a and very simple programs one attached
somemade mention of trisb txsta and spbrg
are these set automatically using the pbp commands if not i have no idea how to set them melanie gave some instruction on setting fuses but not sure
what i need to set
can someone help/
Which boot-loader & serial LCD are you using?
using microstudio for boot loader but have tried no loader with the same results using a serial lcd from redbinary lcd is 2 * 16 it does display its strartup message so assume electrical is ok they onmly deal with c programing not much i know about that (nothing)
Here's your code with a couple of tweaks, have not tested it though:
Code:'**************************************************************** '* Name : UNTITLED.BAS * '* Author : JACK CLEAVER * '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 2/17/2007 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** @MyConfig = _HS_OSC & _WDT_OFF & _PWRTE_ON & _LVP_ON @MyConfig = MyConfig & _BODEN_OFF @ __config MyConfig ; sets your programmer's "fuses" TRISB = %11111110 ' ALL B AS INPUTS EXCEPT B.0 TRISA = %11111111 ' ALL a as inputs INCLUDE "Modedefs.bas" ' This is a must have for serial communications using serout CMCON = 7 ' turn off comparators ADCON1 = 7 ' turn off a/d converter DEFINE PIC16F877A DEFINE OSC 20 DEFINE LOADER_USED 1 ' Boot-Loader is being used DEFINE OSC 20 ' We're using a 20MHz oscillator DEFINE CHAR_PACING 1000 x var byte w1 var byte w1 =0 Setup: w1 = 1 pause 1400 Main: for x = 1 to 6 SEROUT portb.0,6, ["ABCD", #w1] 'mode 6 = N9600 mode 2 = T9600 w1 = w1 + 1 PAUSE 250 next x GOTO Main END
Last edited by Archangel; - 20th February 2007 at 02:41.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
thanks for the reply will try this have moved display over to a 628a and get
fairly good some garbage dont know what that is
also trying to send a escape sequence to set up the serial chip
but that does not work any ideas on this tried
dec 27 or hex 27 or "<esc>" not working
interesting will not display esc here with the <>
also why the garbarge do want to move this back to 677a so will be trying your setting
again thanks for the feedback
Last edited by jcleaver; - 20th February 2007 at 12:13.
tried it with and without max works better without
does not seem to mater still get garbarge (some) also displays corectly
and unable to fiqure how to setup chip escape sequence
Last edited by jcleaver; - 20th February 2007 at 13:11.
It can't work with both cases (with and without max232) using HSER commands! Are you sure of what you are doing????
I never used any Serial LCD's so I don't know of the ESC sequences. But with Serout commands you can drive a PC without MAX232. I am not sure if you can drive a slave device too... I'd use a MAX232 for sure.
Ioannis
Last edited by Ioannis; - 20th February 2007 at 14:18.
If this: http://www.redbinary.com/sld01a.php is the LCD driver you're using, then it looks like you'll want to use 9600 non-inverted. It should also work directly connected to your PIC hardware USART pin.
I a getting the display to work with the attached file so i assume
hook up and baud is right
using serout2 commandportb.7 on a 628a not using the max works better
however i also get garbage and cannot get the esc sequence to change the display properties
file does not compile with the latest effort to send esc
tried others no help
where you have "<esc>" in your code, that generally means the ASCII character "Escape" similar to how you see "<cr>" for carriage return.
Try replacing that with 27 or $1B and see how you get on. (No difference between them except that 27 is decimal and $1B is hex.)
Last edited by keithdoxey; - 20th February 2007 at 15:32.
Keith
www.diyha.co.uk
www.kat5.tv
@9600 baud AND using the internal OSC AND using SEROUT2, it's high unlikely that it will work. Using DEBUG or HSEROUT may work.
with HSEROUT, use the following DEFINEs
For ANY reliable serial comm, you really want to use a crystal or a ceramic resonator.Code:DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_SPBRG 25 ' 9600 Baud @ 4MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
still canot get serial lcd driver to work
when i use hserout i dont get anything
with the above commands
and really nothing shows on my scope as anything from the pic627a
using pin 8 labeled tx
is this the correct pin
does not work with or without max
really unsure which is correct
about to return to the lcdout command and hookups
just wanted to save pins
they do shoot horses
? hserout does not work on the 627a why no usart on this ?
serout 2 works using the max but data is garbled ? see attached file
thanks for any updates
know the program is hodge but just trying to see something on the display
got to that but garbarge
Last edited by jcleaver; - 21st February 2007 at 17:02.
??? The 627 does have a USART. the 627/628/648 are the same apart from 1k/2k/4k memory
Just looked at the link posted earlier by Bruce. The driver chip you have is a 16F627A according to the schematics on the website so just connect the TX of your PIC to the RX of the LCD driver and comms should be perfect.serout 2 works using the max but data is garbled ? see attached file
It would seem that unlike a lot of Serial LCD backpacks, this chip is trying to be clever in so much as it wants to just display any serial data it receives....
LCD Formatting
The LCD can be configured for a specific number of columns and lines with two additional escape sequences.
The desired number of columns is set by first sending the escape character, then a lower-case 'x', followed by two digits specifying the number of columns allowed before the SLD01a forces a line-break.
The LCD line count is specified in a similar manner - escape, lower-case 'y', and two digits.
Two digits must be used, even when the number of lines can be represented with one. For example, to set the SLD01a into a 16 x 2 format you would send "<esc>x16<esc>y02"
The LCD configuration is saved in the SLD01a EEPROM which is persistant even when removed from a power source. This makes it only necessary to configure the SLD01a once for any given LCD format.
Non-Text Characters & Escape Sequences
When either non-printable linefeed or carriage return character is received the SLD01a will line-break by causing the LCD cursor to move to the first character placement on the next line of the display. After the last character of the last line is reached, the SLD01a will clear the display and begin again at the first character of the first line.
When the non-printable delete character is encountered, the SLD01a will reposition the LCD cursor one position to the left, deleting the last displayed character.
When the non-printable bell character (ASCII 7) is encountered the aux pin (pin 6) will briefly energize. This is the same procedure as the 'b' escape sequence.
Proprietary escape sequences allow for some additional features. All escape sequences are triggered by sending the escape character (ASCII 27 [0x1B]) to the SLD01a. Table 1 lists the single character escape sequences recognized and the functions that they perform.
CHR DESCRIPTION DEC HEX FUNCTION
c lower-case C 99 63 clear LCD screen and place cursor at home position
b lower-case B 98 62 briefly energize the auxillary output (pin 6)
O upper-case O 79 4F turn auxillary output on
o lower-case O 111 6F turn auxillary output off
L upper-case L 76 4C turn LCD backlight on
l lower-case L 108 6C turn LCD backlight off
To me at least, that says it wont understand the LCD positioning commands you are trying to send it.
MY interpretation is that once powered up and told how many characters and how many lines there are to the display (which it will remember forever) it will then start to print from the home position until the first line is full then it will print on the next line until it reaches the end when it will clear the display.
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks