Serial -in Serial - out pass through

Wingrider

New Member
Is it possible to pass the data coming in on the serial_in pin C.5 on a 08m2 to the serial_out pin C.0 ? At this point I am using another IC ,CD4066, to control where the data on the data line is coming from, either from the 08m2 or the original data source.
What i would like to do is pass thru the data that comes in on serial_in C.5 to the serial_out C.0 and do away with the CD4066
 

Wingrider

New Member
Is it possible to pass the data coming in on the serial_in pin C.5 on a 08m2 to the serial_out pin C.0 ? At this point I am using another IC ,CD4066, to control where the data on the data line is coming from, either from the 08m2 or the original data source.
What i would like to do is pass thru the data that comes in on serial_in C.5 to the serial_out C.0 and do away with the CD4066
Could the mods please move this to the right forum. Sorry I didn't realize I was in the wrong forum.
 
Last edited by a moderator:

techElder

Well-known member
I'm missing your logic here. If you already have the process covered by the 4066, why do you need the PICAXE?

I think at best you will have to do a store-and-forward process.

Is this a continuous SERIN to SEROUT process, or is it intermittent? The reason being that the PICAXE will be too busy to do anything else while this is going on.

Are you intending to change something in the stream as it goes through the PICAXE?
 

AllyCat

Senior Member
Hi,

Is it possible to pass the data coming in on the serial_in pin C.5 on a 08m2 to the serial_out pin C.0 ?
It rather depends if your "data" is individual (spaced) characters (bytes) or a more continuous "stream".

In principle, yes you can use SERRXD and then SERTXD (or SEROUT or HSEROUT on the same pin with an 08M2). But beware that using SERRXD will prevent any further Program downloads until you understand the "Hard Reset" procedure (see the DISCONNECT command).

You will also need to decide how the PICaxe is going to "multi-task" the transfer of the data bytes with whatever else it needs to do. Maybe an interrupt or multiple Starts ?

Cheers, Alan.
 

oracacle

Senior Member
it is possible to receive serial from any input and pass it through to any output.
I have done this is the past, but the code overheads can be large and will vary depend on what you need to do with the data.
Does there need to be an address? does the 08m2 need to look at the information just in case in needs to be listened to? are the number of 08m2s' change? What is the data coming from and going to?

As an idea the sensors that I built based on the 08M2 could be daisy chained together, they self addressed depending on the position in the chain. The master can be just about anything that can be coded to send the right data to control them. The addresses were important as the mode of the sensors were pre-programmed to know what they had to do when told the mode by the master. although it is still possible for the master to talk directly to any 08m2 on the chain (chain can be 250 long). Information can be passed through in both directions.

here is more info on the sensors
http://www.picaxeforum.co.uk/showthread.php?29075-quot-Smart-quot-Sensors&highlight=smart+sensor
 

Wingrider

New Member
The circuit is to activate a motorcycle GPS. The Honda Goldwing Nav must be activated manually before you start moving otherwise you are locked out until you stop and activate it. This circuit opens the data line from the dash panel to the Nav board and then the 08m2 sends the Enter command over the data line to the nav board. This activates the Nav without any intervention by me. If for some reason the circuit fails to activate I can press a switch and the 08M2 will check to see if the bike is moving. If it is it will open the speed sense line, wait a preset time, open the Data line then send the commands necessary to activate the Nav then closes the data line.
The circuit as designed and the coded works perfectly so now I am playing with it. If I can remove the CD4066 the board layout a lot simpler and the parts count drops.
Lastly it is a question I asked that I can't answer.
 

hippy

Technical Support
Staff member
You should be able to use the Data Signal Modulator (DSM) which is inside M2 chips to route either incoming serial or SEROUT generated serial through to the GPS. There's no specific Basic command for that but it can be configured using PEEKSFR.

Untested, would use SEROUT C.1 ...

Code:
         .---_---.
        -|V+   0V|-
        -|SI  C.0|-------> TX to GPS
BTN >----|C.4 C.1|--.
      .->|C.3 C.2|<-|-.
      |  `-------'  | |
      `-------------' |
 RX >-----------------'
 
Last edited:

premelec

Senior Member
@hippy... could you be a little more specific? I was unable to locate Digital Signal Modulator and it's not Apr 1 yet...
 

hippy

Technical Support
Staff member
Sorry, it's "Data Signal Modulator", not "Digital".

It's not supported directly nor documented by ourselves but is available for the M2 devices, detailed in the Microchip datasheets -

http://www.picaxe.com/What-is-PICAXE/PICAXE-Chip-Labels

It's basically a 'this or that' selector which can select from a variety of sources and allows which is selected to be be set from a similar variety of sources including a high/low bit in one of the SFR registers.

The following (untested) will allow the MDBIT bit to select input C.2 or C.3 signal and put that out on C.0 ...

Code:
PokeSfr $FC, %11000000 ; SFR $39C MDCON
PokeSfr $FD, %00000000 ; SFR $39D MDSRC
PokeSfr $FE, %00000001 ; SFR $39E MDCARL
PokeSfr $FF, %00000010 ; SFR $39F MDCARH

PokeSfr $FC, %11000000 ; Output C.3 on C.0
PokeSfr $FC, %11000001 ; Output C.2 on C.0
And it looks like I screwed up my earlier diagram. I'll correct that; SEROUT to C.1 which links to C.3, C.2 the external RX.

C.3 used from C.1 rather than RX because there's no pull-up on C.3, but that doesn't matter if driven from C.1. It would if RX were RS232 usinga current limiting resistor.
 
Last edited:
Top