I am an undergraduate student at the Dept of Mechanical Engineering, University of Bristol, UK. I am developing C-code to control car fuel injectors in high speed IC engines. However, i have only rudimentary knowledge of C, so I was wondering if anyone can help with the following problems:
1. Which library function do I need to include in order to get the bit size of voltage in each channel of the input ADC ISA bus card?
2. How do I initialize the ADC/DAC card (ie give it a base address?)
3. What is the syntax to actually measure the size of the bit value on each input channel?
4. What is the syntax required to output a bit value to the output channel? IE can I "switch" the output channel to give a set voltage for a set interval of time?
If it is any help, here is some code which I think performs these operations in Quick Basic language:
'PC Card Initialisation
ba% = &H700 'hex base address
OUT ba% + 3, &H92
Chan0 = 0
Chan1 = 1
Chan2 = 2 '........etc
'Getting readings from channels
OUT &H702, Chan0 * &H10 + 2
For z% = 1 to 80: NEXT 'delay due to finite reading time
OUT &H702, Chan0 * &H10 + 3
For y% = 1 to 80: NEXT
xc% = (INP(&H701) AND &HF) * 256 + INP(&H700)
uc% = (204.75 * u + 2047.5) * (-1)
msb1= (uc% AND HFF0)/16 AND & HFF
lsb1= (uc% AND &HF) * 16
OUT ba% + 13, msb1
OUT ba% + 12, lsb1
Thank you very much for any help you can provide: if you cannot provide help, are there any internet forums where I might be able to air these queries?