Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Firefly 16F88 RS232 problem

Status
Not open for further replies.

futz

Active Member
I've written code to send text from the Firefly to my PC using the AUSART. First odd thing I noticed was that it worked fine when run slow in the debugger, but sent nothing when run at full speed. :confused: :confused: :confused:

I finally found that if I put a short delay right after setting SPBRG during the init, it works normally. I've never had to do this before. Is it something specific to the Firefly or the 16F88, or have I just been lucky up to now with 16F's?

**broken link removed**
 
Last edited:
Are you using the INTOSC? If so, this is a symptom I've seen on several different PIC devices including the 16F88.

On my 16F88 boot-loader I actually include an additional delay after testing the oscillator stable flag before using the UART.

Mike
 
Mike said:
Are you using the INTOSC? If so, this is a symptom I've seen on several different PIC devices including the 16F88.

On my 16F88 boot-loader I actually include an additional delay after testing the oscillator stable flag before using the UART.

Mike
Hey! That could be it. I am using internal osc. The program is tiny and gets right to business doing the one thing it does - spit data out the RS232. I'll take out the delay and put a osc-stable check and see what happens.
 
Yup, that cured it. No delay needed. Just a quicky little oscillator-stable loop, waiting for the IOFS bit to get set.
Code:
init
	banksel	OSCCON		;bank 1
	movlw	b'01110110'	;internal 8mhz osc
	movwf	OSCCON
stable	btfss	OSCCON,IOFS	;oscillator stable?
	goto	stable		;no, wait
	.
	.
	.
I guess I must have always used crystals before, and they start up faster, or I had bigger code that did other things while the osc stabilized.
 
blueroomelectronics said:
I wonder if that applies to all PICs with an IOFS bit. Good thing to know.
I experienced the same symptom when using INTOSC on my 18F2520 and 18F2620 bootloaders too. It seems to take just a tiny bit longer than "oscillator stable" for the oscillator to be "on frequency"...

Mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top