We are trying to run a VFD display using a max232 and a pic16f876a micro and we are using MPLAB to write the C code to run our display. Could anyone help us with the code ? This is what we got so far.
Code:
// Global Variables
unsigned int Counter1; // total pulses counted so far
unsigned int Counter2; // # of TMR2 interrupts seen
unsigned int SPEED; // # egdes / 100ms (100*rev/sec)
unsigned int REF; // desired speed (100*rev/sec)
bank1 unsigned char MSG[10]; // sci message coming in
bank1 unsigned char MSG_LENGTH; // length of message
bank1 unsigned char TEMP; // temp variable
bank1 unsigned char N; // temp length of message
bank1 unsigned char FLAG; // 1 means carriage return seen
This will write "LOVEtCourLOVE?" scrolling and over again to our Display. Which I believe tells us two things we have the correct Baud rate coming out from our pic and we have connections right. We wanted to figure out how to right code that goes where we want it and stops repeating. Also if it makes sense would help.
Thanks any help is appreciated.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Feb 09, 2009 4:11 pm
Are you using the CCS compiler ? This is not CCS code. It's pseudo-ASM
code, written for some C compiler.
Here's the full manual for the VFD display:
http://www.elektroncso.hu/cikkek/gu140x32f-7000_e04.pdf
Look on page 8 for the serial interface specification. You need to write
a serial transmit function that will poll the SBUSY bit, and wait until the
VFD can accept a byte. Then use the putc() function to send a byte to
the VFD.
There are jumper selections on page 29 of the VFD data sheet, which
show how to configure the baud rate.
You may have to send an initial reset pulse after power-up and wait for
the specified time before sending data to the VFD.
You can use the CCS serial port library code, which is invoked with the
#use rs232() statement. It may or may not be RS-232 levels (it might
be TTL levels, non-inverted). You need to determine that.
I don't want to do this for you. You need to study the CCS compiler
manual (if you have the compiler) and do it yourself.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum