Remote control by location (PIC in Oshonsoft)

ericgibbs

Joined Jan 29, 2010
21,451
hi,
I think I see where you have gone wrong.
You don't Paste the name of the listing to that window, you post the actual text listing.

So when viewing the listing in OSH, select and Copy the complete listing and post that in the window for Code.

You can also select and Copy a short clip from the code listing and post that bit...

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
I think I see where you have gone wrong.
You don't Paste the name of the listing to that window, you post the actual text listing.

So when viewing the listing in OSH, select and Copy the complete listing and post that in the window for Code.

You can also select and Copy a short clip from the code listing and post that bit...

E
Hi E,
I don't follow: "You don't Paste the name of the listing to that window, you post the actual text listing."

I use the term program, which I think you use listing?
I copy the whole program/listing, and either paste it into a TX or post the whole thing into CODE, Is this correct?

I alway get errors. (This has only just started)
C
 

trebla

Joined Jun 29, 2019
599
Hi C,
When i tried copy your code to Insert -> Code window to i got same Oops error. Maybe code is too long or there are some weird characters inside which prevented normal upload?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
The actual Program Code Listing is too long.!

E
Hi E and T,
Is the method in #935 acceptable? Am I the only one with CODE this long?

Anyway, it's there if anyone want to read it.
Note: This is from a while back, but the latest full CODE. It is wired for the PCB5, so I've got to go through it and check all pinouts, clarify notes, I made, then introduce the peripherals one by one, while testing each.
C.
 

trebla

Joined Jun 29, 2019
599
When progam goes complex then is wise to break it to multiple files. PBP has INCLUDE directive for including code file chunks into main program file at pointed locations (i dont know about Oshonsoft capabilities) but it is not that convient as in C. I think you better go with current program organisation until you can manage your device to work as intended.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
When progam goes complex then is wise to break it to multiple files. PBP has INCLUDE directive for including code file chunks into main program file at pointed locations (i dont know about Oshonsoft capabilities) but it is not that convient as in C. I think you better go with current program organisation until you can manage your device to work as intended.
Hi T and E,
I've used INCLUDES and will do once I get things working better. This program is miles beyond me thanks to members help and addition, and I've just been drawn along, well beyond my cababilities. As you may have noticed by the sending BYTES/WORDs questions. It takes me a couple of days to focus in:)
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
Hi,
Here's a screen shot, of 2x terminals receiving radio signals. 1x 18F56K20 TX PIN, and 1x through the radio.
Can someone remind me what makes these errors please?
when I first tried, they were almost correct.
C
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi C,
You are printing extended ASCII codes, look at the table in this link.
Compare your printed letter with the ASCII letter.

Post a sample of the string you would expect...

E
https://www.ascii-code.com/
Hi E,
Actually there's no peripherals connected yet, so all after = are generated.
I think I follow.
This line is correct: CH1= 298 CH2= 149 CH3= 172 CH4= 204 CH5= 267, although the numbers are also generated. I'll add peripherals, and see what I get.
Thanks,
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
I mean what should this string be.?
View attachment 235137
Hi E,
At the moment I'm programming MASTER 18F46K20 which send DATA to the SLAVE something like: MOSI= Compass READings 'BYTES'. and the SLAVE send back to the MASTER MISO= which would be QEI count, plus the Compass result of calculation in DEG 'say' '175', but could be in any form sensible.
So in the MASTER SLAVE1 would =, separated by commas, for the MASTER to PARSE.
EDITED
C
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,451
hi,
Modify the strings from
like: MOSI=12,23,34,45. and the SLAVE send bck to the like: MOSI=12,23,34,45

MOSI=12,23,34,45 to say MOSI=1234567890
ie: create a dummy message string for testing

Post what you see.

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
Modify the strings from
like: MOSI=12,23,34,45. and the SLAVE send bck to the like: MOSI=12,23,34,45

MOSI=12,23,34,45 to say MOSI=1234567890
ie: create a dummy message string for testing

Post what you see.

E
Hi E,
I program MASTER and SLAVE at different times, so I don't get mixed up, but will post as soon as poss.

Just had JAB2:)

EDITED #954
C
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,451
hi,
The reason for using a known test string from the Slave that at the moment you do not know if the Slave Source thats sending the string, is getting wrong data to send
OR
the receiving Master is reading the string incorrectly
OR
the there is data corruption in the transfer sequence.

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
The reason for using a known test string from the Slave that at the moment you do not know if the Slave Source thats sending the string, is getting wrong data to send
OR
the receiving Master is reading the string incorrectly
OR
the there is data corruption in the transfer sequence.

E
Hi E,
I follow, but as you know this CODE is quite long, and for me very difficult. As you can see from my EDIT in #954, I easily get mixed up.
At the moment, I have found some missng parts to the MASTER CODE, e'g' there is no READ COMPASS section, so I'm adding it in, then I'll work through each peripheral, so I know they're working, as previous PCBs, then switch to the SLAVE.
C
 

ericgibbs

Joined Jan 29, 2010
21,451
hi,
You don't need a full program to test the transfer, create a short debug program.

Use a spare master/slave pair of PIC's and plug them into the PCB sockets, unless you are using solder in PIC's??

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,832
hi,
You don't need a full program to test the transfer, create a short debug program.

Use a spare master/slave pair of PIC's and plug them into the PCB sockets, unless you are using solder in PIC's??

E
Hi E,
I'm using surface mount components, and will do that as soon as poss.
C.
 
Top