Remote control by location (PIC in Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Hi, (TEMP only 4xChannels)
Here is a RECEIVER program: 18LF4520 RECEIVER 150718 0900
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

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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

jayanthd

Joined Jul 4, 2015
945
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

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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
945
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.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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
945
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.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
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
945
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:

ericgibbs

Joined Jan 29, 2010
18,766
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
 
Top