April 24, 2024, 12:53:12 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


IWBasic & EBasic [Console App] : Project PCF8591 Direct

Started by Techno, March 14, 2011, 04:13:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Techno

Hi all,

This program may be free used and also change .
Let me know what tips, tricks on the improvements you make so I can learn it

Thanks
Stephane

Datasheet : PCF8591
Book : PC Ports Under Windows, ELEKTOR
Software : Console version
Include files : see the other posts (part1 & part 2)



$USE "Inpout32.lib"
$USE "i2c_com2.lib"
$INCLUDE "i2c_rs232.inc"
DECLARE IMPORT, Sleep(int time)

GLOBAL Output
$MAIN
OPENCONSOLE
DEF Output AS CHAR
INPUT "Uitvoeren Datawoord: " , Output
DAC_Write(0x64, Output) '0110 0100 =
PRINT "Invoer = ", ADC_Read()
DO : UNTIL INKEY$ = CHR$(27)
CLOSECONSOLE

SUB DAC_Write(ControlByte AS CHAR, DataWoord AS CHAR)
    i2c_Start()
    i2c_Write(0x72 * 0x02 + 0x00) 'adres 72, schrijven
    i2c_Write(ControlByte) 'schrijven van de controlbyte
    i2c_Stop()
RETURN
ENDSUB

SUB ADC_Read(), CHAR
    i2c_Start()
    i2c_Write(0x72 * 0x02 + 0x01) 'adres 32, lezen
    i2c_NoAck()
    i2c_Stop()
RETURN i2c_Read()
ENDSUB

Egil

You write PC Ports Under Windows, but there is no such book. But Elektor sells a book called Serial Ports under Windows and one called Serial Interfaces under Windows.
Are you referring to one of them??

Regards,
Egil
Support Amateur Radio  -  Have a ham  for dinner!

Techno

Egil,

You right

That are the correct titles:

PC interfaces under Windows: measurement, control and regulation under Windows

Burkhard Kainka, Hans-Joachim Berndt - 2001 - 296 pagina’s - Voorbeeld
Serial Interface Every PC has one or more serial interfaces, which in the manuals are usually designated COM 1 , COM2 et seq. ... Therefore, additional serial interfaces are often used side by side in the PC.
http://www.dsaprojects.110mb.com/special/books/7.html

Question:

Can you give tips how I can developed an Win32 app with EBasic & IWBasic?

Best regards




Egil

When Larry has finished rewriting the serial libraries for IWB and CB, and selling them again, writing such an application will be easy. I bought the first versions from Paul Turley a couple of years ago, but haven't stated useng them till recently. The serial comms program i posted in the User Offers section of the forum use the CB version of the library.
I will post code using that libraies when they are released again.

Good luck!
Egil
Support Amateur Radio  -  Have a ham  for dinner!