hserin 600 chars

ciseco

Senior Member
Hi,

I'll be upfront with you on this one, if it can be done, it will end up in a commercial prototype, just wanted to be clear, so one or two people who have issues with me using PICAXE's for "work" not hobby can chose or not to give any help.

I've got a device that I'm communcating with that is working fine, there is however one part I don't think I can actually acheive with a picaxe. The device puts out nicely formatted results, which I strip the values out of, this is all fine.

There is one particular function that returns nearly 600 characters so over runs the scratch pad a good few times.

Question to you guys is - is there a way of capturing all the 600 chars (38400bps) in some way so I can break it up into values?

Cheers

Miles
________
Hilux platform
 
Last edited:

moxhamj

New Member
Not with picaxe directly. I've got a Z80 prototype board that could do that but it is 6 months off being ready as a working board.

Do you have any control over the characters? I'm thinking if you did, you could put a sequence of flag characters eg "ABC" in the middle of the group, and use an 08M with this as the qualifier and then that chip could read the next 14 bytes.
 

Mycroft2152

Senior Member
Hi,

I'll be upfront with you on this one, if it can be done, it will end up in a commercial prototype, just wanted to be clear, so one or two people who have issues with me using PICAXE's for "work" not hobby can chose or not to give any help.

/QUOTE]

Miles,

As "one or two people", I have no issue with using a PICAXE for work. Commercial projects are a fine use of PICAXE.

My issue is your using the good will and time of volunteer forum members to increase your profits.

I am sure many of the "brain trust" would be happy to assist you with development of a commercial project - for a price.

Myc
 

ciseco

Senior Member
Myc, I'm more than happy to pay you or indeed anyone else if there is a solution, as long as that person doesn't mind me sharing it publicly afterwards also. I have already recompensed one of your fellow countrymen with his favorite chocolate (his choice) for the advice he gave me, so I am not here looking for freebies as you keep claiming. Making a profit, mmmm, I look forward to that day, I hope it's soon, been at this for 8 months and it's mostly out not in :(

Cheers Drac, something similar had crossed my mind but I assumed because 38400 was so fast I'd not be able to clock anything fast enough to use serin with a qualifier, every value is preceeded by ":"

I'm also a little limited on space and I'm already down to the 28pin SS version of the PIC that unfortunatly I can't buy in PICAXE form, need to ask if they'd consider doing it, until then it's , do do de do, stop! programmer time :D
________
Rambler Tarpon
 
Last edited:

ciseco

Senior Member
I must stop using hserin in this context, I meant hsersetup and background recieve

Have I just answered my own question, can hserin be used with a qualifier, mmmm, time to get that manual out again :)
________
Straight-4 engine
 
Last edited:

moxhamj

New Member
What sort of device only outputs at 38400 baud and only a minimum of 600 bytes? I'm just curious as, yes, there are workarounds, and yes, one can build a dedicated "protocol translation" board, but if the original device can be modified/tweaked etc it would be much easier.
 

BeanieBots

Moderator
Does the sender have any form of data control? Many devices which don't have hardware control will respond to Xon/Xoff commands.
 

ciseco

Senior Member
The device is a teridian meter IC

http://www.teridian.com/products/product_detail.cfm?product_key=67

It does output huge logs also, which at 38400 still take a minute or two to squirt down. I'd wrongly assumed throwing this much data around would screw our network up, to my surprise it still works even during a heafty download, I guess there's still enough bandwidth left between the 250K of the XBees and 38400 download from the device, was chuffed to bits.

Have the X2's surfaced yet?

Yes the original can possibly be tweaked, firmware is running on the terry's 8015, am just discussing the implications of it with the designers, seems little point having two processors in one box, but such changes are not part of their overall plan so although saying yes, it's a "probably" yes. I've since found out the device has been tested with an external CT and can measure incoming and outgoing power (ala G83 grid tied inverters) so it's becoming more apparent the device has many uses and doing a proper aProtocol port might be worth considering.

Wow CPM not heard that since I had an Amstrad when I was a kid, I'd be really tempted to build one (closet geek) as you say not much use to me now though :(

I'll ask beanie, hadn't even crossed my mind, nor thiers I suspect, very good point, I know CTS/RTS isnt an option.

What I've asked for is if they can insert a little pause between lines so it gives the PICAXE enough time to process one then move on.
________
Honda Varadero specifications
 
Last edited:

womai

Senior Member
One possibility, assuming the 600 bytes come in a continuous stream (or at least their overall timing is always the same, no randomly variable pauses between the single bytes):

Use two Picaxe 28X1's with their hserin inputs hooked to your sender in parallel (i.e. they both can see the data stream). In addition, the first Pixaxe (the master) has one output going to an input on the second Picaxe (the slave).

First, Picaxe 1 (the master) is waiting to receive data (via background hserin to the scratchpad). It constatntly monitors the number of bytes received so far. Once that gets close to the scratchpad size, he sets the output line to the slave high. The slave monitors that state of the line (easily done with an interrupt) and once it goes high, starts receiving serial data itself into its scratchpad. The master on the other hand stops serial receive so its buffer does not wrap around and overwrite the beginning of the received data.

So at the end you will have the first portion of the data block stored in the master, and the second stored in the slave. For even longer data streams (which is your case), just cascade additional Picaxes in the same way.

There will (and should) be some overlap between the data blocks in one Picaxe and the next, you can use that to figure out how exactly to put the full block back together.

If that ends up in your product I wouldn't mind a sixpack of my favorite beer, and RevEd owes me something as well because I made you use three times as many Picaxes as before :)

Wolfgang
 

ciseco

Senior Member
Womai,

Cool bananas, I like the idea, that's a possible solution, will try to breadboard it up.

What's you favorite beer? I'll happily stand you a sixpack.

Miles
________
Daihatsu Opti picture
 
Last edited:
Top