Look at that...
http://www.picbasic.co.uk/forum/atta...6&d=1118138371
Yeah the same placed on another website but for PBP... from the same guy![]()
Look at that...
http://www.picbasic.co.uk/forum/atta...6&d=1118138371
Yeah the same placed on another website but for PBP... from the same guy![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I was just going to mention your calculator Steve. Beat me too it.
Robert,
I think you're looking at the wrong table. 10-3 is for BRGH=0. For BRGH=1, see table 10-4.
@ 20mhz, with BRGH=1, and SPBRG= 0, the baud rate is 1250K, that's 1.25 million bits per second. And the formula works with that one.
DT
Crap, and I had checked my work too. Getting old...
Steve's utility gave this (real cool, can check calculations instantly, saves me from typing that into an Excel sheet):
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 10 ' 115200 Bauds
I'm not a fan of all-encompassing hex values like that, I like to know what is happening. Is there a significant difference in performance if I set the bits manually like this?
DEFINE HSER_SPBRG 10 ' 115200 Bauds
RCSTA.7 = 1 ' SPEN Serial port enable
RCSTA.4 = 1 ' CREN Continuous receive enable
TXSTA.5 = 1 ' TXEN Transmit enable
TXSTA.4 = 0 ' SYNC Asynchronous communication
TXSTA.2 = 1 ' BRGH High speed baud rate
I like comments, it helps make up for a miserable memory. I can toggle stuff ON and OFF easily that way. I usually ignore default values, but I make exceptions for important and relevant settings like SYNC in the example above.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Steve, any chance of letting the baud rate utility accept 1250000? That is a valid speed according to the datasheets, but the utility does not accept it.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
These values work in the utility:
FOSC=20
SPBRG=0
20/16(0+1) = 1.250 = 1250 KBAUD
These don't:
FOSC=48
SPBRG=0
48/16(0+1) = 3.000 = 3000 KBAUD
Don't you hate 18F MCUs?
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
nope i don't hate them... it's more a matter of updating it to fit with the EUSART.... as already asked a while back.
Do you really need it as this fast is always my question
I'll do the EUSART thing one day.
For now, i'd modified the baud restriction. try it... use it to your own risk and all the usual disclaimer stuff. Didn't test it in real environement so, if it works, it works case not... too bad![]()
Last edited by mister_e; - 21st July 2006 at 22:08.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, I don't know exactly how fast I need it the USART to go. All I know is that it has to be fast enough so that I can transfer 2 bytes from the 16F to the 18F without losing the USB connection.Originally Posted by mister_e
I had some difficulty in coming up with a baud rate that was compatible between a 16F @ 20MHz and a 18F @ 48MHz. Since I can't change the FOSC for the 18F because of USB, I did the next best thing and adjusted the FOSC on the 16F. I used 16 MHz which is a multiple of 48, I figured I could come up with a compatible SPBRG value that way.
Sure enough, SPBRG=0 @ 16 MHz and SPBRG=2 @ 48 MHz both give 1000 KBAUD. It's not the maximum of 1250, but it's close. Now I have to make some tests later and see if the USB connection holds up.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bookmarks