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.
Help with connecting LK162 to PIC24FJ
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,
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
Design and Development
Matrix Orbital
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
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
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 !
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 !