URM37 V3.2 with OSHON.

Status
Not open for further replies.
hi Paul,
Try this program in your PIC to URM, I have added some delays to the Hserout subs.

Remove the .txt extension from the file
 
Hi Eric.

After much hair ripping and shouting I decided to double check everything. This is when I realised I had made a 'take it for granted' mistake. Earlier I was convinced that the PIC just wasn't transmitting. I checked with the logic probe and sure enough a pulse on pin 8. What I now realise is that I didn't check the other end. It turns out that the ZIF socket I have has a bad connection on that pin. Aggghhhhh!

So I now have comms back to the PC terminal from the pic. I have disconnected the URM and now emulate this with the PC. Upon switch on I would expect to see

00 00 00 00 - Set mode
11 00 00 11 - SendCommandTemp

However the PC terminal report :

80 80 80 80 91 80 80 c4 (extra space to make it easier to read)

Any ideas? - Maybe this IS a timing issue now.

Regards - Paul
 
hi Paul,
I assume that the PC's UART is set for 1start bit, 8 data bits and 1 stop bit, no parity.???

Usually: 9600,n,8,1
 
Yes it is ....

hi,
It looks as though its adding Bit 7 to each Byte.??

With your test meter, when the PIC is NOT transmitting, just Idle, the TX pin of the MAX232 connected to the PC input should be at a minus voltage.??

Can you check it.?
 
Last edited:
Ok Eric -7v

Hi,
I will set up here what you have. I will use a 16F877 PIC , I dont have a 16F648 .

ie: Programmed PIC to PC as a URM emulator, will let you know what I see.

Which PC program are you using to emulate the URM.?

For ref , the CONFIG you have set is for LVP ON, No PWRON delay, Brown Out enabled.???
 
Last edited:
hi Paul,
Programmed a 16F877 with a modified version of your Basic program. it just loops every 500mSec to send 11h,00h,00h,11h and then 22h, 00h, 00h 22h [ no commas].

Look at the RS232 print out on this image.

I will program a second PC as a URM emulator.

E.

Note: the full stops between Bytes is only on the display so its easier to read
 
Last edited:
I use the OSHON PC Serial Port Terminal for emulation. The config I ignore and set everything to off in the MPLAB burner.
 
Hi Eric,

Well I made this video .....

https://www.youtube.com/watch?v=nfFpqQ2N3Ss

I decided to change the MAX232 and see what happens. It's the only thing I haven't tried yet. I have tried several PIC's.

Having changed the MAX 232 I do get what I would expect MOST of the time. Sometimes it throws a wobbly and sends incorrect data.
 
OK so it's not CODE. This is some weird electronics thing I think.

I'm going to break it all down and start again electronically. My development peg board has seen better days and I hate those thin wires ....

Regards - Paul
 
Nothing to do with changing the MAX232. :-( as expected. The problem still remains .......

I feel you may be receiving a package in the post Eric.

Many thanks for all your help with this.

Regards - Paul
 
WOO HOO cracked it ....! (Well the first bit anyway ....

The URM 37 was connected to the same 5v ov lines as the RS232 / TTL. Disconnected it and 11 00 00 11 22 00 00 22 etc.....

Why this should be I have no idea. Im off to find anothe PSU now ....
 

hi Paul,
Be sure to have good shared 0V connection to all the devices, PC, URM and PIC.

E
 
Hi Eric,

I have uploaded another video so you can see what's happening.

https://www.youtube.com/watch?v=xPG...DvjVQa1PpcFM-SqdCb6h8tKumdV0h-GTvHpKxrHBnVMw=

I can now emulate the URM with the PC properly and see the proper commands coming back from the pic.
I can also just connect the URM and emulate the pic from the PC.

Connecting it all together is a no go. For some reason when ever I connect the URM the commands from the pic get corrupted. - Possible noise? - but this is even witout the data lines connected.

I tried a seperate PSU and commoned all the 0v and still the same probem.

Progress IS being made although slowly. At least now I know my (our) code works ...... ;-)

Regards - Paul
 
hi Paul,
Watched that vid a number times, its strange why just powering the URM without any other lines should effect the RS232 data.??

I cannot see from the vid, but are you sure that those two end pins on the URM are the power and not the RS232.??

Do you have decoupling capacitors on the Bread board power rails.?

E

EDIT:
I dont see any decoupling caps on the BB.??
 
Last edited:
hi Paul,
Install the Visual Basic 5 runtime files [ free on the web]

You can then use the CmdComm1.exe [it emulates the URM] in place of the Oshonsoft PC Uart program, its a a lot easier to use.

The swingy1c.bas is a modified version of your original basic program.

It will accept Tempr and Distance commands in any order. [your original program had to be Tempr > Dist > Tempr > ...]

Its also possible to Inc/Dec the Tempr/Dist values from the URM.

E.

Use the UART option to select the Comm port your PC uses.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…