LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pic 16f877 rs 232

Solved!
Go to solution
I hate it when it happens to me as well. Usually altenbach isn't too far behind ... Wonder if his ears are burning up right about now.  Smiley Very Happy
0 Kudos
Message 21 of 39
(2,883 Views)

thanks very mutch my friends!!

the ADC problemes is all resolved!

now i´m into digital ports:

I´m sending 8bits(portB)data from pic to pc.the data is 0 to 255, but i want to convert into binary so i can put some led´s to visualise input data from pic.

i have seen some exemples here but i didn´t understud !!

EX: if portB value is B=00000010; than  led nº2 is on!

i hope you understend my question!!

thanks again.

0 Kudos
Message 22 of 39
(2,871 Views)

Don't know what examples you're referring to, and I hope they're not like the ones you had posted earlier.

 

All you need is the Number to Boolean Array function.

0 Kudos
Message 23 of 39
(2,869 Views)

thanks . i´m using that ,but some times leds on labview are blinking!!!!

Is that normal???i´m using pic on a breadboard .....do you sink is that the probleme?

whith ADC aquisition ,on the waveform chart some times hapens that to( the valiu goes down to zero, and than goes back to it)this hapens very fast.

 

0 Kudos
Message 24 of 39
(2,860 Views)

hello again my freinds!!

with your help i´m learning meny things ,and i just dont´t know nothing!

Well a can read from pic to pc ,digital ports and ADC`s!

now i want to send data to pic (16f877a )to Portd! does the prog have any probleme?

0 Kudos
Message 25 of 39
(2,830 Views)

my pic programme is this:

 

0 Kudos
Message 26 of 39
(2,826 Views)

Two coding comments.

 

1.  What is the point of the while loop with numeric8 in it?  It is just a loop that runs superfast for as many iterations as the number in 8.  Nothing happens otherwise.

2.  No need to wire up all the constants to the index array function.  The first element defaults to zero if you leave it unwired.  The other elements default to consecutive values if you leave them unwired.

 

As for your VISA write.

 

If you have the value 128 in the Numeric 10 control, do you want to send a single byte that is ASCII value 128, or do you want to send 3 characters of "1", "2", and "8"?  The way you have it code now, it is doing the latter.

0 Kudos
Message 27 of 39
(2,826 Views)

 

0 Kudos
Message 28 of 39
(2,809 Views)

To do that you just need to have an array or a cluster of 8 Booleans. If you have an array you can just use the Boolean Array to Number function to get the value to send over the serial port. See attached example. I have no idea what you're doing with the top half of the code.

 


jimboli wrote:

Well, what are you getting on the chart? 

 

Message 29 of 39
(2,801 Views)

hello again my friend!!!

 

well, on top i just want to visualise PortB from pic. when i turn on some(8) switchs ,i can see the corresponding value on these led´s(8)!!

i have tried the programme and it works,but somme thing is wrong !!!

 


i can recive data from pc!!
i just have a litle probleme.from pc i´m sending this data:

( recived)                            (send to portB)
    on pic                             from pc
0 00110000 -------------------0
1 00110001 -------------------1
2 00110010 -------------------2
3 00110011 -------------------3
4 00110100 -------------------4
5 00110101 -------------------5
6 00110110 -------------------6
7 00110111 -------------------7
8 00111000 -------------------8
9 00111001 -------------------9
10 00110001 ------------------10
11 00110001 ------------------11
12 00110011 ------------------12

i dont understand why bit 5 and 4 are alwais ``1´´?!?!

wen i reatch ``ten`` the values are all craizy!!
do you think the probleme is on reciving data (pic programme C )
i have made a lot of tests....
thank´s my friend

0 Kudos
Message 30 of 39
(2,763 Views)