Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 25th September 2008, 08:17 AM   (permalink)
Default Display analog output proplem

Hi all,
I'm working with ADC in PIC16F877. The output is written on PortC in 8 bit.Could I display this output in 3 bit? For example
PortC = 11111111 -> PortE = 111
PortC = 01111011 -> PortE = 011
PortC = 00010001 -> PortE = 010
Could I do something like this? (I checked but not worked)
Code:
movlw B'01111011'
xorwf PortC,w
btfss status,z
movlw B'00000011'
movwf PortE
The problem here is that can I do xorwf with the PortC which is writen by output of ADC process)

Last edited by chilly85; 25th September 2008 at 08:37 AM.
chilly85 is offline  
Old 25th September 2008, 08:31 AM   (permalink)
Default

Quote:
Originally Posted by chilly85 View Post
Hi all,
I'm working with ADC in PIC16F877. The output is written on PortC in 8 bit.Could I display this output in 3 bit? For example
PortC = 11111111 -> PortE = 111
PortC = 01111011 -> PortE = 011
PortC = 00010001 -> PortE = 010
Could I do something like this? (I checked but not worked)
Code:
movlw B'01111011'
xorwf PortC,w
btfss status,z
movlw B'00000011'
movwf PortE
hi,
It would be better if you told us whats the need for doing it this way.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now  
Old 25th September 2008, 09:30 AM   (permalink)
Default

Hi Eric,
I would like to send the output from PIC to computer by parallel port
But in parallel port I have only 3 bit (3 pin ) to read this data.
That's why I have to change from 8bit to 3 bit
chilly85 is offline  
Old 25th September 2008, 09:39 AM   (permalink)
Default

Quote:
Originally Posted by chilly85 View Post
Hi Eric,
I would like to send the output from PIC to computer by parallel port
But in parallel port I have only 3 bit (3 pin ) to read this data.
That's why I have to change from 8bit to 3 bit
You understand you can only represent 0 to 7 states with 3 bits.

Divide the 255 value by 16, right shifts required.

Q1: why have you only got 3 bits available on the PC's paraport.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 25th September 2008 at 09:42 AM.
ericgibbs is online now  
Old 25th September 2008, 09:43 AM   (permalink)
Default

If you have only 3 bits then send it serial. Use the bits as Enable, Clock & Data. The enable will allow you to recover if a bit is somehow missed when windoze goes of on one of it's tea breaks.

Mike.
Pommie is offline  
Old 25th September 2008, 10:02 AM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
You understand you can only represent 0 to 7 states with 3 bits.

Divide the 255 value by 16, right shifts required.

Q1: why have you only got 3 bits available on the PC's paraport.?
In the parallel port I have 8 pin for input and output.But I used 5 pins for output already. So I have 3 pins left for input
chilly85 is offline  
Old 25th September 2008, 10:04 AM   (permalink)
Default

Do you have a serial port?, that would make everything far simpler for you, on both the PIC and PC sides.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 25th September 2008, 10:08 AM   (permalink)
Default

Quote:
Originally Posted by Pommie View Post
If you have only 3 bits then send it serial. Use the bits as Enable, Clock & Data. The enable will allow you to recover if a bit is somehow missed when windoze goes of on one of it's tea breaks.

Mike.
Hi Mike,
Did you mean that I have to use 3 bits like: 1 bit for Enable, 1 bit for Clock, 1 bit for Data?
Could you explain more detail?
chilly85 is offline  
Old 25th September 2008, 10:10 AM   (permalink)
Default

Quote:
Originally Posted by chilly85 View Post
In the parallel port I have 8 pin for input and output.But I used 5 pins for output already. So I have 3 pins left for input
If I follow correctly, you dont understand the parallel port configuration.

Can you say how you are using the '5 pins'.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now  
Old 25th September 2008, 12:32 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
Do you have a serial port?, that would make everything far simpler for you, on both the PIC and PC sides.
Hi Nigel Goodwin,
I have a serial port. But could you tell me which program should I use in computer for reading this analog signal? Can I use Labview?
chilly85 is offline  
Old 25th September 2008, 12:36 PM   (permalink)
Default

Data is data, it's up to you what you do with it once it's in the PC - I've no idea what Labview is capable of, but Hyperterminal will read the data and store it in a file.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 25th September 2008, 12:57 PM   (permalink)
Talking

Quote:
Originally Posted by ericgibbs View Post
If I follow correctly, you dont understand the parallel port configuration.

Can you say how you are using the '5 pins'.?
I'm not sure what I'm doing is correct or not. Each I/O pin of parallel port I connect to outside circuit by a wire. So I can use each pin separately (from D0 to D7)
By the way, I will read more about parallel port configuration.
Thanks Eric

Last edited by chilly85; 25th September 2008 at 01:01 PM.
chilly85 is offline  
Old 25th September 2008, 01:01 PM   (permalink)
Default

Quote:
Originally Posted by chilly85 View Post
I'm not sure what I'm doing is correct or not. Each I/O pin of parallel port I connect to outside circuit by a wire. So I can use each pin separately (from D0 to D7)
hi,
D0 thru D7 are normally configured as PC output pins.

They can be configured by the PC's program as inputs if required.

It would help if you could post a sketch of what you have connected to the port.

EDIT: this table may help.
Attached Images
File Type: gif esp02 Sep. 25.gif (26.4 KB, 3 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 25th September 2008 at 01:06 PM.
ericgibbs is online now  
Old 25th September 2008, 01:10 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin View Post
Data is data, it's up to you what you do with it once it's in the PC - I've no idea what Labview is capable of, but Hyperterminal will read the data and store it in a file.
Thanks for your suggestion.
I would like to thank for your PIC tutorial online too. I have learn a lot from that.
chilly85 is offline  
Old 25th September 2008, 01:16 PM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
hi,
D0 thru D7 are normally configured as PC output pins.

They can be configured by the PC's program as inputs if required.

It would help if you could post a sketch of what you have connected to the port.

EDIT: this table may help.
The parallel I'm using is bi-directional one. So I can use D0-D7 as input or output
chilly85 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Analog output PICs Shohadawy Micro Controllers 8 26th September 2008 03:53 PM
Analog Output jmmjvg Micro Controllers 12 23rd July 2007 04:38 PM
Sinusoidal steady-State proplem tinhnho Electronic Projects Design/Ideas/Reviews 7 8th November 2004 06:09 AM
TTL to Analog Display??? Squintz General Electronics Chat 2 5th February 2004 02:34 AM
Analog output PLC CQM1H problem goekgoek General Electronics Chat 0 24th June 2003 09:08 AM



All times are GMT. The time now is 01:56 PM.


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

eXTReMe Tracker