discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] GRC: Serial Port to Block Diagram Interface


From: Josh Blum
Subject: Re: [Discuss-gnuradio] GRC: Serial Port to Block Diagram Interface
Date: Thu, 14 Jan 2010 14:46:12 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8pre) Gecko/20100113 Shredder/3.0.2pre

You should make a hier2 block that has a gr.message_source inside of it. You can put data you read from the serial port into a message queue. (internally) The message sink will pop items off of the queue and into a gnuradio stream.

Take a look in grc/grc_gnuradio/blks2/* for example. Several of the blocks in there make use of these message blocks and message queues. Then, to get the block in grc, you can make an xml file modeled off of one of the blocks in grc/blocks/*.xml

Hope that points your in the right direction.
-Josh

On 01/14/2010 02:17 PM, John Bonn wrote:

Hello friends..

I'm trying to setup some experiments to utilize the GRC environment. As a
part of it, I'm reading samples off an ADC connected to a microcontroller
connected to PC via UART/RS232 Serial, using PySerial module.

  I have been trying to write a Source block for GR, where a listening thread
would read the ADC samples from the Serial port into a global variable, and
then, another thread wud "probably" pass the data into a gr.vector_source
(like?) block within a hier2 block.

Well, that was just the idea. But I guess the system doesn't work this way.
I'm not sure whether I'm entering the message-blocks domain, which is
expected to support such packetised(?) data. I read in the GRC Wiki - "add
custom blocks" section that it might be possible to make such "special"
functionality encapsulated in a block-diagram-safe block. Any suitable
examples ?

Conflicting again is the thought that ultimately samples from USRP and Audio
sources are also probably caught in chunks and assembled into streams. But
the sources for them look too complex and spread out for me to look into
right now.

I hope someone will make it clear for me and point me in a direction I can
look for a quick hack.

Cheers,

John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]