Truncated match.
PICList
Thread
'9600 baud @4MHz code is here'
1995\11\16@005311
by
Newfound Electronics
|
>
>>Julio,
>>Forwarded reply you requested.
>>P.S. You should be able to get 9600 baud @ 4Mhz without oscilliscopes or
>>much difficulty.
>
> Thanks for the reply. But I would rather some code that really works. :)
>I'm hurry to finish my application. Thanks anyway.
>
> Julio
>
Julio,
Sorry the code is not formated very well as had to port it from DOS into
windows and it scrambled everywhere! This is what I used before and it is
based on the microchip application note, not the best but it worked. By
memory it worked well but the timings were not exact. No doubt others on the
PIC LIST will add and detract from it especially as it came from me.
Of course don't forget to change the processor type as needed. I have
assembled it and there are no assembly errors but I have not tested it and
maybe I destroyed the code when I removed the peripherial features in the
"XMTW" routine. I also had to make a small change the "SERIN" routine after
porting so this has not been tested by the assembler.
If you get stuck trying to get it to work, let me know and I'll see what I
can do.
Sorry for any mistakes in my English.
Regards,
Jim
;SERIAL ROUTINES 9600 BAUD @4MHz
;
list p=16c57
flags equ 3 ; (Hang over from Z80 days!)
cntl_port equ 7
c equ 0 ; Carry Bit is Bit.0 of F3
org 08
rcvreg res 1
xmtreg res 1
count res 1
dlycnt res 1
baud_x equ .29
baud_4 equ .43
baud_3 equ .16
baud_2 equ .33
baud_1 equ .35
baud_y equ .31
dout equ 3
din equ 2
user movlw baud_3
movwf dlycnt
redo_2 decfsz dlycnt
goto redo_2
serin
clrf rcvreg ; clear all bits of rcvreg
btfsc cntl_port,din ; check for a start bit
goto user ; delay for 104/2 us
nop
movlw baud_4
movwf dlycnt
decfsz dlycnt
goto $-1
movlw 8 ; 8 data bits
movwf count
r_next bcf flags,c
rrf rcvreg
btfsc cntl_port,din
bsf rcvreg,7
decfsz count
goto dlyy
movlw baud_3 ;last half of last bit delay.
goto save
dlyy movlw baud_y
movwf dlycnt
decfsz dlycnt
goto $-1
goto r_next
xmtw movwf xmtreg
xmtr movlw 8
movwf count
bcf cntl_port,dout ; send start bit
call delay1
x_next bcf flags,c
rrf xmtreg
btfsc flags,c
bsf cntl_port,dout
btfss flags,c
bcf cntl_port,dout
delayx movlw baud_x
call save
decfsz count
goto x_next
bsf cntl_port,dout ; send stop bit
movlw baud_x
goto save
delay1 movlw baud_1
save movwf dlycnt
redo_1 decfsz dlycnt
goto redo_1
retlw 0
end
1995\11\16@132936
by
Paul Christenson [N3EOP]
>Sorry the code is not formated very well as had to port it from DOS into
>windows and it scrambled everywhere!
>flags equ 3 ; (Hang over from Z80 days!)
>cntl_port equ 7
>
>c equ 0 ; Carry Bit is Bit.0 of F3
>
> org 08
You probably would have been better off leaving the code in its !
"scrambled" form. If you are running Eudora under Windows, be !
advised that by default it displays everything in a proportional !
font. You can change it to a "monospaced" font, and things will !
line up properly. !
!
As a test, the line to the right side of this message ------> !
is (supposed to be) vertical. If it isn't, either the editor I'm !
using chopped off some spaces, or you are using a proportional font. !
(However, it looks fine from here...) Could someone tell me if it !
is or not? Thanks... !
!
Paul !
1995\11\16@194009
by
Newfound Electronics
|
>You probably would have been better off leaving the code in its !
>"scrambled" form. If you are running Eudora under Windows, be !
>advised that by default it displays everything in a proportional !
>font. You can change it to a "monospaced" font, and things will !
>line up properly. !
> !
>As a test, the line to the right side of this message ------> !
>is (supposed to be) vertical. If it isn't, either the editor I'm !
>using chopped off some spaces, or you are using a proportional font. !
>(However, it looks fine from here...) Could someone tell me if it !
>is or not? Thanks... !
>
Thanks for that info Paul, it will be very useful in the future.
Your line was all over the place but half a bottle of scotch will
straighten it out nicely (until the morning anyway. Well maybe the
monospaced font is a better choice. :-)
Remember, if anyone fines it doesn't work let me know and I'll fix it, ok?
It certainly worked reliably for me.
Regards
Jim
P.S. For some reason my email is starting at message 2 when I collect it.
I will get this fixed but in the meantime if someone has sent email and I
haven't replied in 24 hours max, this is why.
-----------------------------------------------------------------
NEWFOUND ELECTRONICS, Now available WARP-3
Programs all PICs, 3 textool sockets. can reduce erase time 40-50%
ISP port, fast, All options. 24Cxx & 93Cxx serial eeprom read/program
bonus offer. Price: TBA approx $100US
email spam_OUTnewfoundTakeThisOuT
ne.com.au
------------------------------------------------------------------
1995\11\21@064515
by
John W. Gutmann
"Paul Christenson [N3EOP]" <km4ba!kd4nc!emory!PSUVM.PSU.EDU!PJC130> writes:
> >windows and it scrambled everywhere!
> (However, it looks fine from here...) Could someone tell me if it !
> is or not? Thanks... !
> !
> Paul !
Paul,
I received your mail and I am using 80 col screen, with
mono spaced font. The line was vertical and straight up
in the same column.
John W. Gutmann
--
__ _ _ _ _ John W. Gutmann - SYSOP - Robots R4U BBS - 404-978-7300
|__) |__| | | .....john.gutmannKILLspam
@spam@robot4u.atl.ga.us INTERNET EMAIL
| \ | |__| ROBOT HOBBY; The Complete Manual for Individuals and Clubs
__ __ __ R.E.A.L. - Robot Experimenter Amateur League - Atlanta, GA
|__) |__) (__ ROBOTS R4U BBS - P.O. Box 2050 - Stn. Mtn., GA - 30086
|__) |__) __) Voice 404-972-7082 Ans Machine - FAX 404-979-3660,,,,11
1995\11\21@064515
by
John W. Gutmann
"Paul Christenson [N3EOP]" <km4ba!kd4nc!emory!PSUVM.PSU.EDU!PJC130> writes:
> >windows and it scrambled everywhere!
> (However, it looks fine from here...) Could someone tell me if it !
> is or not? Thanks... !
> !
> Paul !
Paul,
I received your mail and I am using 80 col screen, with
mono spaced font. The line was vertical and straight up
in the same column.
John W. Gutmann
--
__ _ _ _ _ John W. Gutmann - SYSOP - Robots R4U BBS - 404-978-7300
|__) |__| | | john.gutmann
KILLspamrobot4u.atl.ga.us INTERNET EMAIL
| \ | |__| ROBOT HOBBY; The Complete Manual for Individuals and Clubs
__ __ __ R.E.A.L. - Robot Experimenter Amateur League - Atlanta, GA
|__) |__) (__ ROBOTS R4U BBS - P.O. Box 2050 - Stn. Mtn., GA - 30086
|__) |__) __) Voice 404-972-7082 Ans Machine - FAX 404-979-3660,,,,11
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- Today
- New search...