Searching \ for '[PIC]: 16f628 UART Question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: '16f628 UART Question'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 16f628 UART Question'
2001\10\26@014750 by Josh Koffman

flavicon
face
Hi All. Before I go out and spend a bunch of money and time on these
tiny treasures, has anyone had any bad experiances with the UARTs? Is
there anything different between the UARTs on these chips and the ones
on the f877? Will they both run up to the same speeds? Specifically will
they run at 250kbps and 9 bit recieve? I haven't noticed anything in the
datasheet, but I might have missed something.

Thanks,

Josh Koffman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\10\26@122719 by Harold M Hallikainen

picon face
       I think I missed the beginning of the thread...  But I've done a lot of
DMX transmit and receive with PICs. Once we got to the 16c74B, I think it
was, all bugs in the UART went away. The only real bug I ever saw was bad
receiving if you had the high speed bit set. Again, this was fixed quite
a while ago and seems to be fine in all chips since then.
       I'm doing DMX transmit and receive (simultaneously) on an interrupt
basis on 16c74b and 18c452. I'm using 9 bit transmission to get the
required 2 stop bits. On the receive side, instead of looking at bit 9,
I'm checking for framing error to detect the break in DMX.
       The 16c74B is used in the shoebox dimmers, 1224, and DMX decoder at
http://www.dovesystems.com . The 18c452 is used in the TechMaster.

Harold


On Fri, 26 Oct 2001 01:27:34 -0400 Josh Koffman <spam_OUTlistsjoshTakeThisOuTspam3MTMP.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\10\26@162127 by Josh Koffman

flavicon
face
Hi Harold. Have you looked at the 16f628s yet? I think they could be an
idea chip to use in small dimmers and relays boxes. Cheap, built in
UART, and small. I know you can't show me any code from your Dove
products, but can you show me any flowcharts or anything? So far all
I've been able to see is Kelly's code. BTW, how is it using the 18x
series? I'd love to start playing with them eventually, but I'm more
than a little intimidated. The main reason I want to use them is that
with more memory, I'd be able to store an entire DMX frame at once. And
now that there are flash versions, I can save money over a windowed
part. Also are they available with 2 UARTs? That would make interfacing
with a PC a lot easier. Does the Starport use a PIC? If so, are you bit
banging one of the ports? Anyway, I'd really appreciate any help you can
give.

Thanks,

Josh Koffman

Harold M Hallikainen wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\10\29@135434 by Harold M Hallikainen

picon face
Josh,

       I've used the 16f628's in another project (see
http://www.denmat.com/solsheet/virtuoso/info_phase2.htm). In that
project, we actually used two 16f628's and a 16c716. The remote handle
has a 628 driving 2 seven segment displays (multiplexed). It also reads
two push-button switches. The data is put onto one "data" wire (carrying
data both directions using simple packets) to the timer board. The timer
uses another 16f628. The timer and the handle communicate using the UARTs
in the 628s. The timer scans the keyboard, drives the display, and tries
to figure out what the user wants to do. Some of the modes are user
configurable, so that uses the EEPROM in the timer's 628. One of the
timers in the 628 is used as a frequency counter to watch a light to
frequency converter chip. That is then scaled by a scaling factor in
eeprom to drive the display to show mw/cm^2 of light to check the system.
Finally, the timer board outputs a PWM signal that drives the power
supply board. The power supply has the 716. The PWM is low pass filtered
to DC and then read by an A/D on the 716. The A/D also reads full wave
rectified AC on the isolated secondary of a transformer. It reads about
200 samples per half cycle of AC. From this it calculates the RMS voltage
driving the lamp and adjusts the firing angle on a triac to make the lamp
voltage proportional to the LPF'd PWM. This lets us regulate the lamp
voltage and control it with the PWM from the timer board.
       So that's what I've done so far with the 628. It IS a nice chip!
       This week (at LDI), we're introducing the IQ512. It uses the 18c452. The
452 IS nice in that it has lots of ROM and RAM space. In the IQ512, we
hold two DMX transmit frames (each 512 bytes). We are transmitting one
while "building" the other, considering input pots, crossfaders, and
patches. Once the frame is "built", we toggle one bit and the DMX
transmit routine switches over (generally mid frame) to transmitting the
frame we just built. The mainline code then goes and starts building
another frame in the buffer we just stopped transmitting from.
       The 18c252 is also very nice. Same RAM and ROM, but less I/O, making the
chip smaller. This was used in the BrailleMaster
(http://www.dovesystems.com/BuildPage.php3?page=braille). The ROM lets us
put in a 400 word dictionary and still have lots of space left. The
dictionary size was limited by the speech chip (ISD4004-08).
       All the Dove Systems DMX products (http://www.dovesystems.com) use PICs.
They all use the UART instead of bit banging DMX. Both transmit and
receive are interrupt routines that call state machines. On some products
I generate the break by disabling the serial port (but that disables the
receiver too!). On others I generate the break using a separate pin on
the PIC. The TX output goes through a resistor to the "break pin", then
on the the MAX488, which we use to drive the DMX line. The break pin is
usually tristated. When I want to send a break, I make it a low output.
When done, set the tris bit again.
       I've found it a pain to try to sync up break and transmit characters if
you are using the transmit interrupt. So, instead, I use a timer
interrupt to generate an interrupt every 50us. By loading the UART every
50us, you are guaranteed that the byte you dump into the txreg will be
sent immediately. When you come back in 50us, you know it has been
completely sent and you can start the break. Come back in 50 us (or
more), and end the break. Works well.
       I'm using the MPLAB ICE to do development for the 18c452 and PICMASTER
for the 16c74. Everything else I have to use crash and burn (try to
figure out why it crashed by staring at the code or simulating, then burn
another chip). The flash chips are nice, but, for development, I always
have several EPROM based chips sitting in the eraser. I just pull one as
I need it and move my crashed chip to the back of the eraser. The flash
chips ARE especially nice when we discover a bug (luckily very rare) in a
product that's on the shelf. Instead of throwing away a few hundred OTPs,
we can reprogram the flashes. We just moved from the 16c74b over to the
16f74. Less cost and less trash!
       The 18c is very nice. In general, I've been able to just move code over
and have it work. Watch out for some subtle differences, though. Over the
weekend I found that incf and decf on the 18c affect more flags than on
the 16c. This caused some interesting problems on some math routines I
got from a library at piclist.org.
       The "access bank" on the 18c seems a little confusing at first, but the
assembler really takes care of it. It's nice to not have to do bank
switching. I put all my directly addressed variables starting at address
0, and they all end up in the access bank so I don't need to deal with
bank selecting. Indirectly addressed variables (like DMX buffers) are
above that. Since they are always accessed by an FSR (and there are three
of them!!!), and the FSRs are 16 bits long, you STILL don't have to deal
with banks. Also, autoincrement and autodecrement are handy. So is movff
.
       Nice chip!  All I need now is pushw and pullw (or popw) and maybe push
and pull status.

Have fun!

Harold

On Fri, 26 Oct 2001 16:34:51 -0400 Josh Koffman <listsjoshspamKILLspam3MTMP.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\29@144519 by Kirk Lovewell

flavicon
face
Harold,
Very nice write up on the new Pic's!
Do you have any experience with C compilers for the 18C parts?  I have a
product using the 16C66 that I would like to port over to the 18C, original
code was done with Hi-Tec.  Any recommendations on best compiler for
professional development (ie. assuming we can afford any compiler and want
the one that will provide the most trouble free operation?)

Kirk

{Original Message removed}

2001\10\29@164934 by Harold M Hallikainen

picon face
       Sorry, can't help here. I keep meaning to do a project in C, but always
end up doing it in assembly using MPLAB. I'm generally able to cut and
paste stuff from existing projects to get me started. Often, though, I
think of a simpler way of handling something and just rewrite it.  Some
day I'll do some PIC C!

Harold

On Mon, 29 Oct 2001 11:33:02 -0800 Kirk Lovewell <.....klovewellKILLspamspam.....ADVPOL.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\31@125946 by Josh Koffman

flavicon
face
Harold, can I send you an offlist email with a couple of questions?

Thanks,

Josh

Harold M Hallikainen wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...