# Remote control by location (PIC in Oshonsoft)

#### ericgibbs

Joined Jan 29, 2010
12,258
hi C,
Do you have question?.
Are those results what you expected.?
E

#### camerart

Joined Feb 25, 2013
2,374
hi C,
Do you have question?.
Are those results what you expected.?
E
Hi E,
No question thanks.
Yes, the results are fine for this little test.
Next the RECEIVER, where it will convert those numbers to times, so there will be a question soon, as I struggle with INTERRUPTS
C

#### camerart

Joined Feb 25, 2013
2,374
Hi, (TEMP only 4xChannels)
Which simulates with the '$' sentence on the 'get_mess' line. The Hardware UART and shows the 4x inputs. Program: 18LF4520 RECEIVER 4xSERVOS 150718 1100 is as above, with sections from a previous test program with interrupt and SERVO outputs on 18LF4431 copied and pasted into it. This doesn't work yet. C. #### Attachments • 6.9 KB Views: 0 • 11.7 KB Views: 0 Thread Starter #### camerart Joined Feb 25, 2013 2,374 Hi, Can someone run this through the Oshonsoft simulator please? Paste:$BASE,65530,65530,65530,65530,? into the Hardware UART

ENABLE HIGHand DISABLE HIGH.are between lines '############################ Depending on which one is commented in makes HSERIN, or INTERRUPT work.

What needs to be done to get both working?
Thanks,
C.

#### Attachments

• 11.7 KB Views: 8

#### jayanthd

Joined Jul 4, 2015
906
Hi,
Can someone run this through the Oshonsoft simulator please?
PIC18 Simulator IDE ? What I have to do in the test ?

#### camerart

Joined Feb 25, 2013
2,374
PIC18 Simulator IDE ? What I have to do in the test ?
Hi J,
Yes, PIC 18 Simulator.IDE.

Are you familiar with the 'HARDWARE UART' tool in Oshonsoft TOOLS, see attached:

Copy and paste this: \$BASE,65530,65530,65530,65530,? into it, 'SEND STRING'

Also show 'Microcontroller' in TOOLS

I'm trying to get the HARDWARE UART tool to show the .AIL, ELE, THR, RUD also RB0 to RB3 should toggle ON/OFF.

Let me know what happens
C

#### Attachments

• 144.5 KB Views: 1

#### jayanthd

Joined Jul 4, 2015
906
See this.

#### Attachments

• 160.8 KB Views: 6

#### camerart

Joined Feb 25, 2013
2,374

#### jayanthd

Joined Jul 4, 2015
906
Hi J,
Ah yes!
It's at #21.
C
Ok. I am checking.

Edit:

Nothing happens at the UART pins or RBx pins.

#### Attachments

• 581.9 KB Views: 3
Last edited:

#### camerart

Joined Feb 25, 2013
2,374
Ok. I am checking.

Edit:

Nothing happens at the UART pins or RBx pins.
Hi J,
Ok,
At the lines between '############################
Comment out ENABLE
and IN DISABLE.
Try that (It needs some time!)
C.

#### jayanthd

Joined Jul 4, 2015
906
How much time it needs ? If you are sure that the code is ok then I can test the .hex file in Proteus.

I tested after commenting both Enable and Disable. Nothing happens at RBx pins but If I comment ENABLE and Uncomment DISABLE then after some time one of the RBx pins turns green.

I got "Ready!" in the terminal window.

#### Attachments

• 596.1 KB Views: 2

#### camerart

Joined Feb 25, 2013
2,374
How much time it needs ? If you are sure that the code is ok then I can test the .hex file in Proteus.

I tested after commenting both Enable and Disable. Nothing happens at RBx pins but If I comment ENABLE and Uncomment DISABLE then after some time one of the RBx pins turns green.

I got "Ready!" in the terminal window.
HiJ,
It takes a few minutes.
No, I'm sure the CODE is not correct, and I'm trying to find out how to correct it.
"READY" should show in both test. If you are getting one of the RBX pins ON/OFF, then it is similar to mine.

I'll carry on going through the CODE.
Thanks, C.

#### jayanthd

Joined Jul 4, 2015
906
HiJ,
It takes a few minutes.
No, I'm sure the CODE is not correct, and I'm trying to find out how to correct it.
"READY" should show in both test. If you are getting one of the RBX pins ON/OFF, then it is similar to mine.

I'll carry on going through the CODE.
Thanks, C.
Yes, One of the RBx pins ON/OFF when string is sent but it takes some time. I will test it once more.

#### camerart

Joined Feb 25, 2013
2,374
Yes, One of the RBx pins ON/OFF when string is sent but it takes some time. I will test it once more.
Hi J,
With ENABLE HIGH (How it should run), I get this: and RB0 and RB1 will have ON/OFF

Thanks for trying.
C.

#### Attachments

• 229.4 KB Views: 3

#### camerart

Joined Feb 25, 2013
2,374
Hi,
I think I've figured out what's wrong? I think it's the INTCON.TMR0IF bit not setting when the INTERRUPT occurs.

Now to figure out why!
C.

#### jayanthd

Joined Jul 4, 2015
906
Do you have any other file for testing. I said I tried commenting both ENABLE and DISABLE and also tried with uncommenting one of those at a time.

#### camerart

Joined Feb 25, 2013
2,374
Do you have any other file for testing. I said I tried commenting both ENABLE and DISABLE and also tried with uncommenting one of those at a time.
Hi J,
Leave ENABLE IN, as that's how it should run normally.

When you ask for another file. Do you mean on this project, or any file? If so then which PIC/s do you use?
C.

#### jayanthd

Joined Jul 4, 2015
906
Hi J,
Leave ENABLE IN, as that's how it should run normally.

When you ask for another file. Do you mean on this project, or any file? If so then which PIC/s do you use?
C.
Any latest file regarding this project. Do you have OshonSoft softwares ?

I mainly use PIC18F26K22 and 46K22. I also use PIC18F2550 and 4550.

Last edited:

#### camerart

Joined Feb 25, 2013
2,374
Hi,
I've tried TMR0 and got nowhere, so I am ow trying TMR1 to see if I can move on, but I can't.

Here is the latest try:

C.

#### Attachments

• 11.2 KB Views: 4

#### ericgibbs

Joined Jan 29, 2010
12,258
hi C,
Can you explain what you are expecting TMR0 to do in this code clip.
Thats located in a ON HIGH Interrupt
I see that you have remmed it out for debugging, but when its included, what is its purpose.?

E
If servo = 1 Then 'The first SERVO PIN is PORTB.0 so SERVO'0' NOT SERVO'1'.
PORTB.servo = 1 'ON
tim2h = 65535 - tim2h
TMR1H = %11111111 'tim1h.HB
TMR1L = %00000000 'tim1h.LB
'''Break '''''''''''''''''''''''''''''''''''
Hserout "tim1h ", strtim1h, CrLf
PORTB.servo = 0 'OFF
'''totaltime = totaltime - tim1h
'''TMR0 = tim1l
servo = 2
Endif