Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | Com3 Help

Discussion forum for the BasicX family of microcontroller chips.

Com3 Help - mikeytoo2003 - Jun 25 20:40:00 2003

I would like to use COM3 as an outbound serial port. I'm comfortable
defining and opening the port but I'm stumped on how to send data to
the port. I've started with the following:

> DefineCom3(0,5, bx0000_1000)
> OpenCom(3, 9600, InQ, OutQ)

What size to I need to define for the queues? I assume the
following defines a queue of 10 bytes:

> Dim Out(1 to 10) As Byte

I can open the queue:

> OpenQueue(OutQ, 10)

But now what? If I wanted to send 1 byte, say x21 out the Com3
port, how would I go about it? What if I wanted to send 10 bytes?
Does anyone have a basic example os using Com3??



______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: Com3 Help - Doug - Jun 26 5:00:00 2003

> I can open the queue:
> OpenQueue(OutQ, 10)
> But now what?

First you open the queue.
But you also have to do DefineCom3 and OpenCom.
Then, you can do PutQueue or PutQueueStr.
Think of the queue as being like the buffer of
a buffered serial port (ie 16550 UART). It's a
fifo buffer. Anything you put into it gets sent
to the serial port. But the DefineCom3 command
sets up the port, and OpenCom associates that
port with queues. An example:

Private HostRecvBuf(1 to 85) As Byte
Private HostSendBuf(1 to 85) As Byte

Call DefineCom3(5, 6, bx0000_1000)
Call OpenCom(3, 4800, DeviceRecvBuf, DeviceSendBuf)

' Sending a string
Call PutQueueStr(HostSendBuf, "Sending to PC")

' Sending a byte
Call PutQueue(HostSendBuf, GpsData, 1)

The last parameter is the number of bytes to send.

-- Doug If I wanted to send 1 byte, say x21 out the Com3
>port, how would I go about it? What if I wanted to send 10 bytes?
>Does anyone have a basic example os using Com3?? >
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://rd.yahoo.com/M=244522.3313099.4604523.1261774/D=egroupweb/S=1706554205:HM/A=1595055/R=0/SIG=1240u9le2/*http://ashnin.com/clk/muryutaitakenattogyo?YH=3313099&yhad=1595055>f8e59e9.jpg
>f8e5ab2.jpg
>
>>Yahoo! Terms of Service.

----------
[Non-text portions of this message have been removed]


______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )