As far as I'm aware (with the help wikipedia!) Qbasic is different to QuickBasic although Qbasic is built on Quickbasic, and I am attempting to use Qbasic..
It seems odd that nothing = 4.99V although I suppose its all got to do with the type of chip on the motherboard and how they react.....
Cheers,
Owen.
PS. just downloaded VB
Hello Ericgibbs,
No i'm not, i was just saying how i think im starting to understand ADC's, the principle of how they work etc... etc..
I've had a thought about this 12 bit ADC, dose that mean throught the serial connection it sends 12 bits of data on the clock pulses each one needing to be indidually read, and then combined into one variable..
If so then I have learnt something!!
Cheers,
Owen
Cheers,
thanks anyways,
I've installed VB but dont understand the code you sent me, would it be so much to ask that you break down in processes what the code needs to archeive, eg does the clock pulse come from inside the IC, to the PC or vice versa....
Cheers,
Owen
To use the PC parallel port [ for whatever purpose] you will need a 25Way 'D' type mating 25 pin plug connector.
Looking at the drawing there are 4 signal wires , clock, data in, data out and chip select ,also a 0V common wire. The wires should ideally be screened overall, no more than a metre long.
All the signals for the MCP3204 are generated by the VB program and the 4 wires carry the signals to and from the MCP.
In order to have 'strong' enough signal levels a 74LS07 buffer ic is required in these 4 wires.
So these are the basic bits you need for any connection to the port.
The VB5 program shows how to drive these 4 signal wires in order to read the MCP 4 adc channels.
Cheers,
I'm sorry if i never expalined it well, the Qbaisc will end up working as data logger to then display on the screen...
I thought the PIC has 4 onboard ADC converters which would give you an number porportional to the voltage, and then if I new the memory locations of the data I could output it in a parallel fashion. The thing on my mind is serial connections sends the data 1 bit at a time, thoes bits then have to be arranged in Qbasic, now is that as simple as:
Inp(&H378); sensors$
or what ever the input port is I can only remember H378.. no in this case would the all the serial data be stored into that sensors$ variable Or just the single BIT that was at the port at that time.
When you respond to this I will amke up my mind as to the direction I think this could be taken...
Thank you,
Owen
channel0
Out Po378, ElDhCh
'send data bits to ADC0 msb 1st
For p = 1 To 24
If Mid$(CmdStr0, p, 1) = "1" Then
Out Po378, ElDhCh
Out Po378, ElDhCl
Out Po378, ElDhCh
Else ' lo
Out Po378, ElDlCh
Out Po378, ElDlCl
Out Po378, ElDlCh
End If
'read each bit and evaluate the weighting, load the array with sum
'if bit is '1' then get Ary value else skip
V = Inp(Pi379) And Dinp
If V <> Dinp Then
ADCValue0 = ADCValue0 + Ary(p)
End If
Next p
Out Po378, EhDhCh 'idle
'divide by 12 bit [4096] and change to a voltage
'change the '5' to suit your parameter scaling
Volt0 = (ADCValue0 / 4096) * 5
AvgV0 = AvgV0 + Volt0
hi,So I would need to repeat that 4 times? and that stores a voltage in AvgV0...
That would work alongside the MCP3204 with the signal lines discussed earlier....
I would like to go with tha option as you appear to be very, very knowledgeable..
I am intrested by the ElDhCh part of the code,
Cheers,
Owen
Is it possible to replicate that code using Qbaisc ..
set the variables El Dh Ch, change the output port etc..
V = Inp(Pi379) And Dinp
If V <> Dinp Then
ADCValue0 = ADCValue0 + Ary(p)
may I ask what dinp is? as well as Pi379?
cheers,
Owen
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?