Searching \ for '[PIC]: Software UART start bit detection' 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=pic
Search entire site for: 'Software UART start bit detection'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Software UART start bit detection'
2002\09\08@235819 by Bob Barr

flavicon
face
I'd like to run a software UART on a 16F877 based on Timer 1. For the
receive side, I need to trigger on a high-to-low RxD transition for
start bit detection. I planned to connect my receive data to pin RC1
to use the internal inverter in the timer 1 input circuit.

Running under the simulator, I've started out with TMR1H and TMR1L
both set to 0xff. I have the prescaler set to 1:1 and the OSCEN,
TMR1CS, and TMR1ON bits set.
According to the Timer 1 block diagram, a high-to-low transition on
RC1 (through the inverter) should go straight through the prescaler
and cause a rollover of the counter which, in turn, should generate
the interrupt.

When I use the async stimulus to create a falling edge on RC1, TMR1H
and TMR1L remain at 0xff and there is no interrupt.
Am I trying to do the impossible here or am I just missing something
basic? Should I plan to use an external inverter and the RC0 input to
generate the interrupt?
Is there anything in particular that I should be doing with the RC0
pin to use the RC1 input? (I'd expect that I should put a pull-down
resistor on it once I get to hardware since it would be a floating
input otherwise.)


Thanks, Bob

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\09\09@011347 by Scott Dattalo

face
flavicon
face
On Sun, 8 Sep 2002, Bob Barr wrote:

> When I use the async stimulus to create a falling edge on RC1, TMR1H
> and TMR1L remain at 0xff and there is no interrupt.

Bob, which simulator are you using?

Scott

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


2002\09\09@021226 by Bob Barr

flavicon
face
On Sun, 8 Sep 2002 22:13:33 -0700, Scott Dattalo <.....scottKILLspamspam@spam@DATTALO.COM>
wrote:

>On Sun, 8 Sep 2002, Bob Barr wrote:
>
>> When I use the async stimulus to create a falling edge on RC1, TMR1H
>> and TMR1L remain at 0xff and there is no interrupt.
>
>Bob, which simulator are you using?
>

I'm using the MPLAB simulator. (I haven't tried gpsim yet but have
been considering it.)

I think I'll just breadboard the circuit and give it a try using ICD.
Since I'm trying to do something a bit out of the ordinary, the
simulator may not be reflecting reality. If all else fails, I can
always throw in the extra inverter and use the RC0 input.

Regards, Bob

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


2002\09\09@022513 by Scott Dattalo

face
flavicon
face
On Sun, 8 Sep 2002, Bob Barr wrote:

> On Sun, 8 Sep 2002 22:13:33 -0700, Scott Dattalo <scottspamKILLspamDATTALO.COM>
> wrote:
>
> >On Sun, 8 Sep 2002, Bob Barr wrote:
> >
> >> When I use the async stimulus to create a falling edge on RC1, TMR1H
> >> and TMR1L remain at 0xff and there is no interrupt.
> >
> >Bob, which simulator are you using?
> >
>
> I'm using the MPLAB simulator. (I haven't tried gpsim yet but have
> been considering it.)

IIRC, MPSIM doesn't interface RC1 with TMR1. It's been quite a while since
I've used MPSIM, so this could now work, or my memory is so bad that I'm
wrong. gpsim does support clocking TMR1 with an external source like this.

Scott

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


2002\09\09@100738 by Bob Barr

flavicon
face
On Sun, 8 Sep 2002 23:25:11 -0700, Scott Dattalo wrote:

<snip>
>>
>> I'm using the MPLAB simulator. (I haven't tried gpsim yet but have
>> been considering it.)
>
>IIRC, MPSIM doesn't interface RC1 with TMR1. It's been quite a while since
>I've used MPSIM, so this could now work, or my memory is so bad that I'm
>wrong. gpsim does support clocking TMR1 with an external source like this.
>

Thanks, Scott. I thought this might turn out to be a simulator issue.
I found that a transition on RC0 does work as I would have expected.
(I guess it's about time I took a serious look at switching over to
gpsim.)

With the '877, though, it's kind of a toss-up between using the
simulator and the ICD anyway. My main reasons for using the simulator
in the first palace were the resolution of the stopwatch timer and the
availability of multiple breakpoints. Now that I've got my timing
dialed in, I'll be doing the rest of my work using the ICD.


Thanks again, Bob

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


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