Help with connecting LK162 to PIC24FJ

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
tj4shee
LCD?
Posts: 6
Joined: Wed Dec 19, 2007 9:16 pm
Location: Lexington, KY, USA

Help with connecting LK162 to PIC24FJ

Post by tj4shee »

I can not get the LK162 and PIC to talk..... any ideas would be greatly appreciated.

Here is what I have tried so far.....

I know I am programming UART comm correctly on the PIC... I altered the PIC program to transmit to hyperterminal and data was received.

I know the LCD is working - I have no problem interfacing it with an ATmega168 via UART

I have moved the UART lines to different pins on the PIC to be sure it was not a problem with pins or a conflict with the programmer.

I setup my PIC to send the signals to the ATmega168 - all the ATmega168 does is relay what is received from the PIC to the LCD - this works fine.

I also attempted to use an op-amp (rail-2-rail) to convert a 3v signal to 5v - cannot get this to work but I am still playing with it

I will also try a diode bridge to convert the 3v signal to 5v....

Anyone have any ideas ??? I can post my code if that will help.... but like I said, the code seems to work fine with several different tests....

So what makes the transmit signal different out of the PIC verses the ATmega168 ? and why can the ATmega168 receive the PIC signal, but the LCD can't ?

Is it something simple like the ATmega168 UART being bi-endian (bit-wise) and the LCD not ? something else for me to research - but if anyone knows the endian-ness of PICs and/or ATmega168s let me know. I guess a simple test would be to send the bits in reverse order and see if anything shows on the LCD.... ie. 254 = 11111110, so I would send 01111111 (decimal 127) instead ?

Like I said, any thoughts on this would be much appreciated.
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello tj4shee,

Thanks for your post.

Your situation is indeed something frustrating. I do not know much about endian's but UART is something standard and should just work.

Please double check your connections. Are you using the LCD in 232 mode?
I bet the culprit is something that is just overlooked. I am sorry for not being a big help. Hopefully someone else out there can shed some light.

Best Regards,
Raquel Malinis
Design and Development
Matrix Orbital
tj4shee
LCD?
Posts: 6
Joined: Wed Dec 19, 2007 9:16 pm
Location: Lexington, KY, USA

Post by tj4shee »

Hi Raquel... Thanks for the post and interest....

I am running in TTL mode.... if that stirs any thoughts on the problem

I am looking into the 'something that is just overlooked' - i hooked the PIC up to a logic analyzer and am playing with it now....

I will post if I get this figured out
tj4shee
LCD?
Posts: 6
Joined: Wed Dec 19, 2007 9:16 pm
Location: Lexington, KY, USA

Post by tj4shee »

Well, the logic analyzer does show signals being sent across... I am assuming other people have interfaced with PIC MCUs prior - without any problems ?

So it narrows it down to something with the PIC24FJ ? maybe it is something with the remappable pins ?

It would be nice to hear of someone that has gotten this to work with a PIC... a PIC24FJ64 especially.

Thanks
tj4shee
LCD?
Posts: 6
Joined: Wed Dec 19, 2007 9:16 pm
Location: Lexington, KY, USA

Post by tj4shee »

WOW !

Short story.... when I first started in the industry, I started with MVS (mainframes) writing JES2 (Job Entry Subsystem - a base function of the OS) exits in assembly....

One day I sat there with a problem... and after a DAY+ of laboring over it, yelling at it for not doing what I meant it to do.... and going through the exit MANY times... convinced I had done nothing wrong.....

I went home that day.... the next day I started over again... and the 1st look at the code convinced me that it would always be the simple things that will drive a programmer nuts.... I was too arrogant to see that I too could make silly mistakes...... I was using the WRONG register prior to a call..... SIMPLE and STUPID mistake....

Ok... sorry for the reminiscing - the problem had NOTHING to do with the MCU, nothing to do with my code, nothing to do with the LK162......

Everyone... PLEASE know that you should take the MCU COMPLETELY off of the programmer before testing serial comm.... I am not sure what the PICkit2 was taking control off... but it prevented serial comm from going across correctly.

Simple, but stupid... I should have ruled this out as one of the first things I tried....

The LK162 is a GREAT addition to my PIC projects now !
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Yes, wow!

At least you got it figured out, and in a relatively short time (well, for me anyways). Thanks for sharing what you've found, I am sure it will help some poor developer out there someday.

Best Regards,
Raquel Malinis
Design and Development
Matrix Orbital
Post Reply