PDA

View Full Version : Please help with EDE702 - Serial to LCD interface



Tomexx
- 28th October 2008, 14:28
Hi,
I've been looking at creating a serial LCD for a while and came across an EDE702 - Serial to LCD Interface IC by Elabinc:

http://www.elabinc.com/Semiconductors/ProductOverview/tabid/57/Default.aspx

It's a very sexy idea I thought using just a single line on the PIC to drive the LCD display (and it only costs around $7)

So finally it arrives and I'm trying to get it to work. I've been strugling for a couple of days and searched the forums for the subject.

Hooked up an oscilloscope to the PIC and it looks like it's sending some data, but the EDE702 isn't doing much (and the LCD is blank).
Here's a test program



'************************************************* ****************
' Using PortB.2 to serially transfer data to EDE702
'
' PortB.2 going to EDE702's RCV port (pin 17)
' LCD connected to EDE702
' Internal OSC used for 16F628A
' 4 MHZ cristal used for EDE702
'************************************************* ****************
@ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_OFF, PROTECT_OFF, BOD_OFF

CMCON = 7 ' Set portA to i/o
TRISA = %00000000 ' outputs
TRISB = %00000000 ' outputs

BAUD con 2 ' Serout T9600=2, N9600=6

WAIT_TIME con 1000
BLINK_DELAY con 1000
NUM_OFF_LASHES con 3

Serial_LCD var PortB.2 ' Serial signal to EDE702
Led var PortB.5 ' heartbeat led to make sure PIC's alive
ctr var byte

INS con 254 ' LCD command mode parameter
CLR con 1 ' LCD clear command
LINE1 con 128 ' LCD line 1
LINE2 con 192 ' LCD line 2

Main:

pause wait_time

' Clear the LCD and print some text on it
serout serial_lcd, BAUD, [ins,clr]
serout serial_lcd, baud, [ins,line1,"Test"]

' Flash Led 3 times (to see PIC working) and turn EDE702's Digital port ON/OFF
for ctr = 1 to num_off_lashes

led = 1 ' led ON
pause blink_delay
serout serial_lcd, baud, [ins,%11111101] ' Digital Output ON EDE702

led = 0 ' led OFF
pause blink_delay
serout serial_lcd, baud, [ins,%11111100] ' Digital Output OFF EDE702

next ctr

goto Main

end




Any help greatly appreciated,
Thanks,
Tom

Acetronics2
- 28th October 2008, 14:32
Hi,

You did not use the SEARCH function :

http://www.picbasic.co.uk/forum/showthread.php?t=9025&highlight=EDE702

Lol ...

Alain

Tomexx
- 28th October 2008, 14:49
Hi Alain,
I did use the search and found the topic you show along with 5 other topics. I also used the datasheet that came with the EDE702. Hooked everything up and tripple-checked it. (Maybe it's time to check it again...)

I've never send serial data through the Pic's line before. So I'm thinking my program has bugs in it. That's why I was hoping that someone who used the EDE702 could shed some light on the thing.

Thanks,
Tom

skimask
- 28th October 2008, 15:27
'************************************************* ****************
' Using PortB.2 to serially transfer data to EDE702
' PortB.2 going to EDE702's RCV port (pin 17)
' LCD connected to EDE702
' Internal OSC used for 16F628A
' 4 MHZ cristal used for EDE702
'************************************************* ****************
@ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_OFF, PROTECT_OFF, BOD_OFF

Use an external crystal and see what happens.
And if you don't have one, since you DO have an o-scope, might want to change the program, make it change the portb.2 line at a known rate, check it with the o-scope and see how far off (if any) your internal oscillator is.
Also, check Appendix A of your PBP manual. 9600 baud at 4mhz is a bit iffy. Try 2400 baud, try a higher clock, try using the hardware UART, try anything.

mackrackit
- 28th October 2008, 15:43
Tom,
Can you post a schematic of the way you have things connected.

And

Try connecting to a PC using hyper terminal or something, this will test your PIC and code.

Archangel
- 28th October 2008, 16:29
Check out this post, code in post 16.
http://www.picbasic.co.uk/forum/showthread.php?t=4972

Tomexx
- 28th October 2008, 17:01
mackrackit,
I didn't draw a schematic, just used/modified the one from the EDE702 datasheet. I'm attaching both the datasheet and a simplified schematic.
Note the schematic shows line coming from the PS's serial port but in my case the line is coming from the PIC.
Joe,
I read the whole topic and while the code works, it is too complex for me. Plus I'd have to have MPASM and compile using that... Not sure how to go about that.
Post #25 looks promissing and I can actually understand it! :)
I'll try that one first and if it's loosing characters then I'll try to use yours.

Thanks,
Tom

skimask
- 28th October 2008, 17:11
In your original program, change BAUD CON 2 to BAUD CON 6 and see what happens...
Key phrase here is:

Note the schematic shows line coming from the PS's serial port but in my case the line is coming from the PIC.
The PBP manual will tell you why this matters...

mackrackit
- 28th October 2008, 17:18
If you are using the schematic posted... you did ground the OSC? The schematic is missing that.

MPASM is simple. Just install MPLAB from microchip (it is on your PBP CD) and tell MCS to use MPASAM.

The only thing you may need to do is change your configs for MPASM. Not a big deal.
http://www.picbasic.co.uk/forum/showthread.php?t=543

aratti
- 28th October 2008, 17:37
Your problem is the internal oscillator. As already suggested in post#4, use a 4 MHz xtal or a resonator also for the pic, and you will see that the serial communication will work.

Al.

skimask
- 28th October 2008, 18:25
Your problem is the internal oscillator. As already suggested in post#4, use a 4 MHz xtal or a resonator also for the pic, and you will see that the serial communication will work.
Al.

Might not be the internal osc though...
As has been pointed out somewhere (don't remember where) before, those internal oscillators aren't as loose as they used to be...unless of course it's an older chip in the first place.

Darrel Taylor
- 28th October 2008, 20:31
The schematic for the EDE702 uses a ceramic resonator, but your code comment suggests you are using a crystal.

Did you add two 22-27pF capacitors on the crystal?
<br>

Tomexx
- 30th October 2008, 01:56
Hi,
1. Tried BAUD CON 6 (instead of 2)..... no go
2. The crystal on the EDE702 has two 22pF caps going to ground
3. Haven't tried a crystal for the Pic (sender) but it's a '628A

Will make the correct schematic and post it (right now I don't have access to a drawing program that will do schematics). Maybe I'll get access to Orcad tomorrow.

I start to get a feeling that the EDE702 is just dead

Till then thanks for your suggestions,
Tom

skimask
- 30th October 2008, 02:48
3. Haven't tried a crystal for the Pic (sender) but it's a '628A

That's what I said to try in post 4.