Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 14th December 2007, 01:50 PM   (permalink)
Default

Quote:
Originally Posted by mister_e
I may agree with some newer PIC wich have internal calibration... and 1% marked on... but this poor ol' 628?
I've used 628's extensively at 9600 baud with the internal oscillator, and have never seen a problem at all.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 18th December 2007, 08:50 PM   (permalink)
Exclamation

thanks for all your replies.

iv decided to not use the DLP because it is causing too much headache. not to mention it is expensive.

instead i have opted to use a usb to serial converter lead from maplin and write serial data to it by again creating a virtual com port. the link below shows the usb to serial converter from maplin i am using

http://www.maplin.co.uk/module.aspx?...doy=18m12#spec


i have set up hyper terminal to have

1start bit
1stop bit
9600 baud
none flow control


i connect my usb2serial lead to the usb of the laptop, a virtual com is created, and i am able to connect to it in hyper terminal. now here is the problem..

i was told that to test that hyper terminal and the lead is ok, short the tx and rx pins of the serial side of the serial-usb cable(pin 2&3).

then type something into the hyperterminal window. this means what u type is sent from the pc, from the USB end of the usb-serial cable, to the serial end and appears at the rx pin of the serial end. because rx and tx are shorted, whatever appears on rx appears on tx, therefore, the same signal is sent back along the USB-serial cable, and recieved at hypeterminal. it is looped or "echoed" back, and the characters appear on the screen. this works. when i un-short these pins and i type on the screen, no characters come up, which is normal, because hyperterm isnt recieving any data, right?


now, i connected the serial end of the USB-serial cable(pins rx and tx), to a 9pin serial d-sub to its corresponding rx and tx pins. i am ONLY using the rx and tx pins because i am not using any hardware flow control.

when i connect them, iv noticed when i type on the hyperterminal, the characters come up!! why is this? i thought ok, maybe my soldering is bad and i have shorted these pins, which is why it is being echoed back, i checked, but nothing. i have not shorted them. how comes what i type into the keyboard is being echoed back and displayed on the screen? note this is only when i plug in the 9pin serial d-sub connecter to the serial end of the serial-usb cable. does any body know what it could be??

i wil try and include a picture to explain this better
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 18th December 2007, 09:20 PM   (permalink)
Default

i have attatched a picture, to try and explain what i mean. thanks
Attached Images
File Type: jpg explanation.jpg (519.0 KB, 18 views)
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 19th December 2007, 05:46 PM   (permalink)
Default

Seems you forgot to connect the DB9 gnd pin to your external PSU gnd.
__________________
Steve
mister_e is offline  
Old 19th December 2007, 08:24 PM   (permalink)
Default

thanks for ur help but it didnt work. i tried a way of finding problem, what i did was..

as u can see, the serial d-sub connector has 2sides. one side with female holes, and the other sides with pins sticking out which have solderd the wire to which lead to my circuit.

when i test using the multimeter with the beep thing, the tx and rx pins on the d sub serial connecter are not shorted.

what i did was, i put a wire in the TX hole of the d-sub, and the other end of the wire i tied to +5V. this now means +5V being supplied to TX pin of female hole of serial d-sub connector.

i then took out multimeter, and put one strobe on ground, and the other strobe on the TX pin of the serial d-sub connector, but on the OTHER side, if u get what i mean.. on the side where i solderd a wire onto it which leads ot my circuit. the multimeter read 5V. that is correct i hear u say. indeed it is.

i then put the positive strobe of the multimetre on the RX pin of the serial d-sub connector (on the side where i have soldered wires onto not the side with the female holes).. it should be zero volts right? because on the other side i am ONLY supplying the TX pin with 5V. well, it was not zero, it was 3.56V.

this implies to me that something is wrong? refer to my picture i posted if u have trouble visualising this. could it be that when i solderd the tx and rx wires into the serial d-sub connector, that too much solder leaked down into the little "cup" and into the connector, forming some kind of connection between the pins. however if there was a connection then they should both be the same voltage right?

does anybody know what the problem may be? thanks
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 20th December 2007, 07:22 AM   (permalink)
Default

You must have a short on your board somewhere. However, it will not work as you still haven't got a level shifter and inverter.

Mike.
Pommie is offline  
Old 20th December 2007, 08:36 AM   (permalink)
Default

I agree with Pommie. You can use a MAX232 if you have a 5V supply or I used a MAX3232 for 3v3 supply with my USART applications.

Mike
mikesmixes777 is offline  
Old 21st December 2007, 03:44 AM   (permalink)
Exclamation

thank you so much for your help. i cut off the dsub serial connector from the circuit, and did the same test by supplying 5V to one of its female holes and testing on other side with multimeter. only the same hole was 5V and the rest were 0. so im going to build the circuit again.


a few questions tho which im a bit confused about. in the datasheet for PIC16F628, under UART section, it says that it uses standard standard NRZ (non return to zero). does this mean that, the signal does not return to zero, i.e, instead of zero it will go to a negative value, then back up to a positive value without "stopping at" zero. if so this isnt TTL is it because ttl is 0 to 5V. if this is the case why do i need a max232 to convert ttl to rs232 if it isnt ttl in the first place because its NRZ? i searched but couldnt find the values of NRZ, i.e, what values the output of the uart will swing between e.g, -/+ 3V?


one more question, using multimeter, i checked on the serial end of the USB-serial dongle whilst it was connected and detected by laptop. the TX pin. it was reading something like -6.25V and other pins were either the same or 0. IF i need a max232 converter depending on answer u give to my question above, is the one in the following link ok so i dont buy wrong one...

http://www.maplin.co.uk/Module.aspx?...2383&doy=21m12

it says from TTL will produce rs232 values of +/- 9V. will this work on what i am using because i think my device uses rs232 of +/- 6.25V. will it still work even tho this chip will produce slightly more?

if my serial port was using +/- 12V would i need a chip which produces 12V or more or could i get away with using one like on the link above?

also, assuming the uart is giving out values of 0-5V (in which case i dont kno what the NRZ is about), obviously i need a max-232 chip, but why do i need an inverter??

again thanks to those ppl who helped me u saved me a lot of headache & black hairs.
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 21st December 2007, 04:00 AM   (permalink)
Default

You could also build this simple inverter, works fine I use it on the Firefly kit. As for NRZ it means "Non Return to Zero" http://en.wikipedia.org/wiki/Non-return-to-zero
http://picprojects.org.uk/projects/simpleSIO/ssio.htm
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 21st December 2007, 08:56 AM   (permalink)
Default

The data sheet is confusing where it states that nrz is used, the actual output is at TTL levels and needs to be inverted and level shifted to work with a PC. The level shifting isn't as important as the inversion which is why the simple transistor versions work (posted by Bill and by me earlier). The chip you linked to is the correct chip. If you google "pic max232" then you will gets lots of examples how to wire it up.

Mike.
Pommie is offline  
Old 21st December 2007, 05:30 PM   (permalink)
Default

hi blueroom thanks for your post. if im not mistaken youe circuit doesnt actually convert to rs232 but just acts as an inverted for the TTL logic coming out of the pic? are there any premade chips which u recommend from maplin electronics which i can buy for inverting the TTL logic, because i really want to keep the hardware components and soldering to a bare minimum due to debugging etc. im not sure which one to get. and to be honest, i dont understand actually why i have to invert the ttl logic from 0 to 5V and 5 to 0V. why does this inversioin have to be done? doesnt the pic uart take care of this? thanks
__________________
life\'s a bitch then u marry one. )
cyprio7 is offline  
Old 21st December 2007, 05:37 PM   (permalink)
Default

Quote:
Originally Posted by cyprio7
hi blueroom thanks for your post. if im not mistaken youe circuit doesnt actually convert to rs232 but just acts as an inverted for the TTL logic coming out of the pic? are there any premade chips which u recommend from maplin electronics which i can buy for inverting the TTL logic, because i really want to keep the hardware components and soldering to a bare minimum due to debugging etc. im not sure which one to get. and to be honest, i dont understand actually why i have to invert the ttl logic from 0 to 5V and 5 to 0V. why does this inversioin have to be done? doesnt the pic uart take care of this? thanks
The MAX232 is the standard RS232 interface chip, and you should be able to find it at Maplin (or any component shop) - you can check my tutorials for how to connect it up, it's quite simple.

The PIC UART is designed to operate with such a chip, and as the MAX232 inverts the logic, any alternative has to. If you dump the hardware UART, and use a software one, then you can invert the logic in software - and use a single resistor feeding the receive pin as the interface (the BASIC STAMP does just that).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 21st December 2007, 07:23 PM   (permalink)
Default

Quote:
Originally Posted by cyprio7
hi blueroom thanks for your post. if im not mistaken youe circuit doesnt actually convert to rs232 but just acts as an inverted for the TTL logic coming out of the pic? are there any premade chips which u recommend from maplin electronics which i can buy for inverting the TTL logic, because i really want to keep the hardware components and soldering to a bare minimum due to debugging etc. im not sure which one to get. and to be honest, i dont understand actually why i have to invert the ttl logic from 0 to 5V and 5 to 0V. why does this inversioin have to be done? doesnt the pic uart take care of this? thanks
You've got to invert the signal from the hardware USART. Simple but not as cheap or common as a MAX232 is the DS275.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 22nd December 2007, 09:01 AM   (permalink)
Default

What happens if you have a DS275 at both ends of a serial connection.

From the data sheet.
"The DS275 Line-Powered RS-232 Transceiver Chip derives power from the data line providing an extremely low-cost and low-power RS-232 serial port interface."

Mike.
Pommie is offline  
Old 22nd December 2007, 02:14 PM   (permalink)
Default

Well there's no need for +12/-12V, a simple 0-5V works fine for RS232, so presumably it would just work using that?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Quik PIC Programming kit Krumlink General Electronics Chat 5 28th January 2008 12:27 AM
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 07:14 PM
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 01:13 PM
PIC16F88, PIC simulator lcd trouble superbrew Micro Controllers 11 17th October 2007 03:18 AM
Programming PIC to generate square wave elec123 Micro Controllers 11 13th October 2007 02:15 PM



All times are GMT. The time now is 09:19 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker