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.

RS232 using transistors? Yet another of my projects...

Status
Not open for further replies.
I've attached a quite early version of yet another project I never started out to do but got a few requests by the local students.

So presenting the Tick PIC Programming Socket & 16F88 Tutor

I was asked to design a simple PIC ZIF programming socket adapter but I just couldn't stop there so I added a tiny 16F88 tutor device I'd use to demonstrate the Inchworm (and a good way to play around with the scads of built in bits on the 16F88). I've also added a 8pin header for from an idea from this site **broken link removed** on his site Gerrit is using a 16F84 as a 12C509 adapter. I thought I could add the same feature and use the 16F88 instead of the 16F84 because...
  1. built in debugger support
  2. built in oscillator (31KHz to 8MHz)
  3. and the 16F84 is are you ready.... OBSOLETE
You could use a 16F628A instead but you'd lose the built in debugger.

I could use a suggestion on what to do with the spare RA4 pin. It's an execllent pin for use with an iButton. But I'm open to ideas.

In case you're wondering why RA2 is open well I'm trying to test it for use as vref using the CVR (I think you simply leave it open for this...) More on CVR and AN2 later.

PS I'll be doing another Inchworm demo in Toronto at Creatron Inc 255 College St on Friday Sept 29 from Noon till 5pm. If you're in the area drop in.
 

Attachments

  • Tick_test.png
    Tick_test.png
    76 KB · Views: 211
The serial interface looks fine, you need the inversion if you're using the hardware USART - if doing it in software you can use just a single resistor (like the BASIC Stamp does).

BTW, the chances of me getting a passport, and finding my way to Canada, are pretty slim! - how about videoing your demo and posting it on your website?.
 
That NPN circuit is fine. My circuit uses N-chan MOSFETs. They both do the same thing.

While most PC and laptop serial ports will work with a Q1 output that only swings to 5v, you might consider connecting the top end of that pull-up to pin 4 or pin 7 on the DB9 connector instead. That way the Q1 open collector output will swing up to whatever positive voltage the PC serial port is using (5v, 6v, 10v, 12v).
 
Last edited:
Bill,

I'm not sure if the 12c509 emulation is worth having. Someone who is really experienced may be able to use an 88 to emulate a 509 but the majority will struggle due to the huge differences in the actual code and hardware (no interrupts, 2 word stack etc). Now the 12F509 is available it's not really worth it.

Some other things you may want to consider are,
Leave space on the board for a RC oscillator on RA4.
Leave space on the board for a crystal on RB6/7 (32.768K) for RTC application.

I notice, you appear to have some of the power lines missing, at the top of the LEDs and the bottom of the switches.

What is the purpose of the voltage divider on RA3?
What is CVR?

Mike.
 
The 12F50x emulation is an iffy one. I've often wanted a way to program the little beasties and with a good head (haven't tried it though) you might be able to make the 16F88 appear as a 12F509.

RA4 Oscillator? It's not an osc pin. It's an open collector output or an analog input. Probably put a 4.7K on it. This will allow for quite a few thing on a single I/O pin. Such as iButton, LDR.

RB6,7 is tied up by the ICD. So much for a 32KHz crystal. It is a tutor so I don't thinks it's a huge loss.

CVR is the D/A converter built into many 8xx pics. If you've got a comparater you've probably got a 16 step resistor D/A there somewhere.

The schematic is not quite done. I'll repost when it is.
 
How about making Vref varible , when i hooked a hall sensor output to the analog input of my F877A , i needed to adjust Vref down to about a volt , because the hall sensor output was just 0.6V max
 
RA4, yes my mistake, I got it mixed up with the timer0 clock in function.
RB6,7, I assumed J3 was a jumper block and could be switched over.

As for the 12c509, I have used a 16F88 to emulate a 509 when I was waiting for some to arrive. When they did arrive it was quicker to just change the code than put all the conditional stuff in. The stack limitation makes using 88 code not really practical.

For example, to set up the DDR you do,
Code:
	ifdef __12F509
		movlw	b'11111111'-(1<<RS232)
		TRIS	GPIO
	else
		movlw	b'11111111'-(1<<RS232)
		bsf	STATUS,RP0
		movwf	TRISB
		bcf	STATUS,RP0
	endif

As you can see it is doable but not really for beginners.

Mike.
 
Mike said:
That NPN circuit is fine. My circuit uses N-chan MOSFETs. They both do the same thing.

While most PC and laptop serial ports will work with a Q1 output that only swings to 5v, you might consider connecting the top end of that pull-up to pin 4 or pin 7 on the DB9 connector instead. That way the Q1 open collector output will swing up to whatever positive voltage the PC serial port is using (5v, 6v, 10v, 12v).

Can I pin it to TX? Don't mind the half duplex. Just want to keep it 3 conductor.
 
Here's hopefully the final schematic of the Tick. I'm still testing the RS232 part and found the level stealing works well. Ahh half duplex...

This will be kit #2 (PCB coming soon!)

Kit #3 (new dolphin) will probably contain a 16F917 as it's base chip. Looks like a nice replacement for the 16F877 and even PICKIT2 users can debug it.

Comments...

Just got an FYI from Mike, K8LH Looks like I'll wait for the 16F887 for #3 (sorry PICKIT2 users, hopefully they'll be pin compatible then it won't matter)
 

Attachments

  • Tick_demo.png
    Tick_demo.png
    65.1 KB · Views: 231
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top