07-10-2009 08:56 AM
07-13-2009 09:12 AM
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.
07-13-2009 09:15 AM
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.
07-13-2009 02:00 PM
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.
07-17-2009 11:55 AM
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?
07-17-2009 12:03 PM
my pic programme is this:
07-17-2009 12:07 PM
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.
07-18-2009 09:27 AM
thanks ravens fan !!!
about the while lop it is some thing i was testing , but you are very right about all.
Well ,what i realy want is 8 boolean swiths to control PortD!
but i have a dougt. is this programe sending any data??? or pic programme is wrong???
thanks for great help !!!
07-18-2009 03:49 PM
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:
but i have a dougt. is this programe sending any data??? or pic programme is wrong???
Well, what are you getting on the chart?
07-20-2009 02:26 PM
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