Shop OBEX P1 Docs P2 Docs Learn Events
0832 LED Display from Sure Electronics project — Parallax Forums

0832 LED Display from Sure Electronics project

T&E EngineerT&E Engineer Posts: 1,396
edited 2012-04-13 22:14 in General Discussion
I came across these new 8x32 (actually it's 32 columns across x 8 rows high) LED displays from Sure electronics that come in green, red and yellow. I think what they are doing is they have bi-color displays that they only use what they need (e.g. green only uses green connections, red uses red connections and yellow uses both green and red connections to get yellow). These LED displays are very thin and the PCB uses a Holtek 1632 LED driver: http://www.holtek.com.tw/english/docum/consumer/1632c.htm . Sure Electronics first designed a 24x16 board http://www.sureelectronics.net/goods.php?id=142 which also uses this Holtek 1632 LED driver. I do have a 2416 but had not written software for it yet.


I searched the internet to see if anyone had written any software for the new 0832 display and was not able to find any information. Then I searched for the 2416 and found someone that wrote code for it using an Arduino micro-controller in their version of C. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439 I also have an Arduino so I tested their code on my 2416 board and it worked fine. I then tried to convert this Arduino C code for the 2416 into SX28 SX/B code for the 0832 and with a couple of attempts, I got it right. I can probably streamline the code a bit better but I don't think it's too bad.



Currently there is a display routine to show up to 5 characters that are 6x8 font size. Actually the DATA statement character font were adapted from the Jonny Mac's Badge.sxb code written for the Parallax Robolympics Badge circuit. However, since the 0832 uses nibbles and not bytes I tried to write code to read in DATA statement bytes for the characters and then split them apart and convert them into nibbles. Another issue was that the DATA statement characters were nibble and bit reversed for the 0832 board so instead of typing in all those DATA statements for the characters over again, I read them in and reversed the nibble bits and then adjusted it for the addressing scheme for the 0832 display. It was harder than I planed but I figured it out with a little help from the forum.



Currently, I have only been able to display up to 5 characters on a single 0832 display. However, these boards can be connected together up to 4 of them in any combination you like. They have v-cut edges to break away if you want an 8x128 or possibly a 32x32 display (using 4 0832 boards). They only difference would be the chip selecting through a dip switch on each 0832 board. However, when I first saw them on the Sure Electronics site at only $8 each, I bought 10 of them, then later found out after the datasheet was released that only 4 could be used together. Later they also released the red and yellow LED versions of the board but the datasheet is the same for all of them.



I hope to also do scrolling, cascading, PWM control up to 16 brightness levels, etc... Yes this HT1632 chip has PWM control by a simple command statement. I have not played around with it yet because I wanted to get out a simple display routine first as I appear to be the first one that has at least released any kind of code for this 0832 board.



Look for more updates to come when I get time.



BTW: The 2 pics are shown with normal lighting and slightly darker room settings. The iPhone camera I used doesn't do LED display's well due to automatic lighting adjusments. I can't wait to try PWM!



Thanks for reading...


Updated the version to SX48 verD2 - less variables used but still need an SX48 unless you trim down the ASCII characters (for use on SX28 then) - ALSO includes DRAW_SCROLL_LEFT and DRAW_SCROLL_RIGHT now.

Updated the version to SX48 verD3 - Scroll 5 character text message left or right off the display. SCROLL_LEFT and SCROLL_RIGHT routines.

Updated the version to SX48 verD5_Test - More efficient nibble useage (now uses both halves of the byte - 40% more program space). Converted program to use (3 of the 4 possible) 0832 displays (3 used due to SX48 array limitations.). This is a TEST version with everything working except SCROLL_LEFT and SCROLL_RIGHT subroutines. Major improvements to the program overall. Also a Youtube video made: www.youtube.com/watch?v=ZuwpYIdtIso&feature=channel_page

Post Edited (T&E Engineer) : 9/20/2009 1:21:15 AM GMT

Comments

  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-05-26 17:02
    I have made an update to include 4 bit PWM (16 brightness levels) and Blinking control in the code.

    All works fine!

    More to come!


    Post Edited (T&E Engineer) : 5/27/2009 4:12:51 PM GMT
  • Thurston HowellThurston Howell Posts: 4
    edited 2009-06-09 01:17
    Hi, T&E Engineer!

    I have a couple of these 0832 displays, but have not been able to get anything to work. I'm using a Microchip 16F628A and using assembler. I think what is confusing me is the commands that have to be sent to initialize the display.

    Do you have to send a MASTER MODE, RC, COMMONS OPTION command? I'm not sure what configuration to use for COMMONS OPTION (I've tried both N-MOS and P-MOS). I'm also assuming that the "X" in the command means "don't care", so SYS EN would be the command 100 0000 001 0.

    Try as I might, using the various commands, I can't get anything to appear on the display. My pinouts are:

    1 - NC
    2 - NC
    3 - CS line from PIC (DIP switch on board has 1 on, rest off)
    4 - NC
    5 - WR signal from PIC
    6 - NC (have tried setting to +5V and -5V with no difference)
    7 - DATA line from PIC
    8 - GND
    9 - +5V (using internal oscillator)
    10 - NC
    11 - GND
    12 - +5V
    13 - GND
    14 - +5V
    15 - GND
    16 - +5V

    I think I understand how to send the commands to up to 4 multiplexed displays, but it would help if I could get just one running correctly.

    Thanks for any tips you may have!
  • Thurston HowellThurston Howell Posts: 4
    edited 2009-06-09 04:13
    Eureka! I took a look at your software and got the proper configuration for the COMMON OPTIONS as well as the commands to send through. I was almost there. After a rewrite, I have the sign working. I believe my problem was pulsing the WR pin too slowly.

    Thanks for posting your code, it was a help! I do have another 0832 on order so when it arrives I'll try to connect the two.

    I'm working on an horizontal scroll routine now that I actually have something showing up on the display.

    Not a bad little display, especially considering the price!
  • CamaneyCamaney Posts: 16
    edited 2009-06-16 23:59
    Hi T&E Engineer, I have a 0832 display and I am learning SX28 SX/B code, can you teachme how to connect the SX28 to the 0832 display? I have the SX Tech Board and also I have the SX28 Proto Board, they are different from the one you are showing in your pictures.

    I appreciate your help, thanks.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-06-19 19:22
    Camaney,

    I did not see your post till now.

    I am using the Parallax Professional Development Board (PDB) and using wires jumped to the 0832 ribbon connection.

    As seen in the SX28 code, you will need to run the following connections:

    ht1632_data·PIN·RA.0· OUTPUT· ' Connect to Data (pin 7)
    ht1632_wrclk·PIN·RA.1· OUTPUT·' Connect to Write clock (pin 5)
    ht1632_cs_1·PIN·RA.2· OUTPUT· ' Connect to Chip Select (1,2,3 or 4)
    ··········································· ' Also bring over +5vdc and ground pins

    Let me know if this is unclear to you.

    You will need an IDC connector and ribbon cable like this:

    http://www.futurlec.com/Connectors/IDCC16.shtml

    http://www.futurlec.com/Cable.shtml

    and an IDC crimping tool would be helpful too.

    I then use an IDC connector on one side of the cable and on the other side I solder it to 16 pins on a header connector like this: http://www.futurlec.com/Connectors/HEADS40.shtml·(you can break off 16 pins worth).

    The pins fit into a solderless breadboard·on the·SX Tech Board. From here you can connect jumper wires from the solderless breadboard connections to the SX header connectors. If you are using the SX28 proto board then you can simply solder the ribbon cable connections to the pads for the SX28 I/O pins.
  • CamaneyCamaney Posts: 16
    edited 2009-06-21 14:02
    Thanks a lot for your reply and detailed information.
    I ordered the parts I need, I will try it as soon as I can.
    Based on your explanation, it looks easy, i will let you know.
    Thanks.
    ---
  • Thurston HowellThurston Howell Posts: 4
    edited 2009-08-11 04:13
    Hello again!

    I've had great luck with these signs. I have 4 of them cascaded and working.

    Holtek tells me that the PWM works on an individual pixel basis, so that you have 16 brightness levels for each pixel. However, the best that I can do is to set a PWM level for one entire panel. With four panels I can have 4 different brightness levels, but it doesn't seem to address anything smaller than an entire panel.

    Have you played around with the PWM?

    When I'm scrolling, I noticed faint horizontal bands, some form of "ghosting". I'm wondering if I should do an LED_OFF, update all of the panel memory addresses then an LED_ON?


    I've also used Sure Electronic's 16*24 and it works very well, too.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-11 09:53
    It is interesting that you ask about the 0832 displays. After the last 2-3 months of entertaining relatives for the summer, I am now just starting to get back into my projects again. I just took my 0832 displays out last night for the first time in a long while. I am working on cascading a 2nd display first then move on to more advanced stuff like scrolling, etc.

    The attached version B code in my first posting used PWM.

    Post Edited (T&E Engineer) : 8/11/2009 11:41:43 AM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-12 13:01
    I have updated the code to "rev C" (ATTACHED IN FIRST POST) which is cleaned up and able to handle displays 1-4 (although I have only tested it on displays 1 and 2) in the demo code.

    However, I am noticing that I am running out of program space on the SX28. This is probably due to the large DATA statements for the string characters. I need to either move this to an EEPROM or go to an SX48. I'm not sure what is·easier·at this point.
  • Thurston HowellThurston Howell Posts: 4
    edited 2009-08-12 13:32
    Hi, T&E Engineer.

    I, too, ran out of program space. I was using a 16F628A which has 2K of space, and switched to an 18F4550 which has around 40K I think. Yes, it was the data that took up a lot of the room.

    I was thinking about the displays and have a thought for you on how to use more of your 10 displays. I did try running more than one panel with the same CS number and they both displayed the same information. You could make a double-sided sign by having four panels on each side and running the ribbon cable from panel 4 on one side to panel 1 on the other. The second side would simply show what's on the first side. Also, you could do a two-line, 8-panel display with a bit of fancy programming. Just set up 3 more pins to work the second display separately. You would have outputs to two signs, and could display different text/graphics on each one. The top sign (with four panels) could have a scrolling message while the bottom sign has a display of date/time, for example. Since the data takes up most of the code, it wouldn't be too taxing on memory to do this. I also thought about doing this and running it as one large sign. If you made up a new font, you could split it from top to bottom. The top sign would display the upper 9 bits of the font and the bottom sign would display the lower 9 bits of the sign.

    I have created a slightly wider, thicker font as well. I have to fix up some of the lower case characters, but when I get it finished I'll post the data for you if you wish to look at it.

    Holtek sent an email back about my question regarding PWM and ghosting. While one technician said PWM worked on a pixel-by-pixel basis, the second one said it's only per panel, which is what I seemed to discover. Regarding the ghosting, they just said it was a problem with the "application circuit". I think I'll try doing an LED_OFF, then updating memory, then an LED_ON and see what happens with that.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-13 00:43
    I wrote a DRAW routine which basically copies 64 Nibbles of DATA statements into the correct layout and displays the picture.

    I had to use the SX48 for additional programming space so this version will require an SX48 Proto Board or something similar.

    See Attached SX48 SX/B code.

    Post Edited (T&E Engineer) : 8/22/2009 4:12:09 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-22 16:11
    I have added 2 new routines.

    DRAW_SCROLL_LEFT and DRAW_SCROLL_RIGHT

    Download the SX48 D2 version from the first post.
  • CamaneyCamaney Posts: 16
    edited 2009-08-30 05:14
    Hi, T&E Engineer
    in your pictures, where is the blue cable connected?

    I am still trying your old version for the SX28 with one 0832 LED display.

    One more thing, I am using the SX Tech Board, do I need to connect a 20Mhz resonator? if yes, can you explain how?

    FYI, I also have a SX48 Proto Board, which I am planning to try later with your new program and more displays.

    Thanks in advance for your help.
    ---
    Update: I finally go it on, but all I can see is a whole bunch of LEDS on, like garbage, and it doesn't change, just blinks quickly. Any idea?

    Post Edited (Camaney) : 8/30/2009 12:27:05 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-08-30 12:03
    Camaney,

    If you are using the either the SX28 or SX48 version, then you will need to use a 20 MHz resonator.

    I don't have an SX Tech board, but from the picture of one on the Parallax site, it needs to be inserted into the only 3 connector socket to the left of the 4 SX-Key programming pins. It doesn't matter which direction.

    http://www.parallax.com/desktopmodules/catalookstore/ImageViewer.aspx?link=Images/Prod/4/452/45205-L.jpg&desc=SX+Tech+Board&PortalID=0&viewerid=-1&mid=-1

    An SX-48 protoboard has it's resonator 3 pin socket labeled as X2 at the center / left side of the board.

    As far as the "blue" cable goes, the only cable I have is a grey ribbon cable with an 16 pin (2x8) IDC connector on one side. It can be plugged into either side of the 0830 display. On the other end of the ribbon cable, I have it individually soldered to a male header of 16 pins so that I can plug it into a solderless breadboard (mini to make it moble) between the SX48 protoboard or the Professional Development Board (e.g. SX28 based). From the mini solderless bread board, if you are using the SX Tech board (e.g. SX28) then you want to run 22 guage wires from the ribbon cable mini board on pins as follows:

    Pin 3 (CS1) -> RA.2 port
    Pin 5 (WR) -> RA.1 port
    Pin 7 (DATA) -> RA.0 port

    If you are using the SX48 program with 1 display then the pins are switch around a little as follows:

    Pin 3 (CS1) -> RB.0 port

    Pin 5 (WR) -> RA.1 port
    Pin 7 (DATA) -> RA.0 port


    IF YOU ARE CONNECTING A 2ND DISPLAY ON AN SX48 PROTOBOARD THEN USE THESE PINS:

    Pin 1 (CS2) -> RB.1 port
    Pin 3 (CS1) -> RB.0 port

    Pin 5 (WR) -> RA.1 port
    Pin 7 (DATA) -> RA.0 port


    I hope this helps. Let me know if you have further questions.

    I also run wires to Vdd (to pin 16 - or any +5vdc connection) and Vss (to pin 15 - or any ground connection).

    Post Edited (T&E Engineer) : 8/30/2009 12:08:48 PM GMT
  • CamaneyCamaney Posts: 16
    edited 2009-08-30 12:59
    I have a 4MHZ and a 50 MHZ resonator, will this work?

    Update: Never mind.

    I made it work (with your big help), using the SX28 tech board, and your SX28 program version.
    It works great!

    THANKS!

    Post Edited (Camaney) : 8/30/2009 1:40:38 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-09-06 00:27
    I have updated the version again to SX48 verD3.

    This now includes 5 character message scrolling either to the left or right off the display. See the original post for the NEW SX/B file.

    More to come....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Smykowski: Well-well look. I already told you: I deal with the customers so the engineers don't have to. I have people skills; I am good at dealing with people. Can't you understand that? What is wrong with you people?

    Post Edited (T&E Engineer) : 9/6/2009 4:52:07 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-09-20 01:13
    I made significant improvements to release SX48 verD5 TEST. This is an unfinished release. However, all works except for text scrolling left and right. It is now developed into (3) 0832 displays. I could only use 3 of the 4 due to ram array limitations. I also made significant improvements in that it now uses both halves of a byte when READINC in instead of using only the first 4 bits (nibble) of a byte.

    Here is a Youtube video and some pics attached: www.youtube.com/watch?v=ZuwpYIdtIso&feature=channel_page

    The SX48 verD5 TEST (SX/B code) is in the original first post.

    Post Edited (T&E Engineer) : 9/20/2009 1:20:25 AM GMT
    2048 x 1536 - 1M
    2048 x 1536 - 1M
  • Roy CarlsonRoy Carlson Posts: 46
    edited 2009-09-20 01:47
    Tim,

    Looking good.· I think it's working great and looks great too.

    Now to work on some switches/variable resistors controls so that a user can have live control of the display speed and/or the ability to start/pause, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    ·
  • ParsecParsec Posts: 20
    edited 2009-09-24 13:44
    Tim, that rocks!

    I take it your experiments with the Sure 6432 LED board wouldn't allow any message scrolling? I was going to pick one up on ebay until I saw your thread about the 0832 LED board. Just glancing at your posts and the PDF for the 6432 it looks like you just have a 1-shot latch-in of data for each LED matrix, that the individual pixels weren't addressable on their own.

    Also, I haven't done the initial research yet, but would you (or others) know off hand if the BS2 or Javlin would be able a sufficient substitute for the SX? I ask because I have been out of the Stamp world since 2005 and I have these two Stamps on-hand already. I'm in the process of ramping up my obsession with electronics again smile.gif I feel terribly rusty so I'm just going to have to sacrifice a weekend and get back in the zone!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-09-24 13:54
    Parsec,

    I am currently rewriting some of the subroutines to better understand them and make them more efficient. Some older code allowed for message scrolling. I will definately get there but its·not quite right·and I want to fix it first. So I will work on it over the weekend and see what turns up on the forum then. Thanks for following.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-10-02 12:54
    This morning at the SURE Electronics website they showed a free demo board for the 0832 and 2416 displays. You willl still need a mini USB cable, 12 vdc power supply, etc. but it controls up to 2 sets of 4 0832 boards and 1 (maybe 2) 2416 displays. It looks promising but they are out of stock at the moment, probably to get the interest of there customers. Also there does not appear to be a manual available yet.

    http://www.sureelectronics.net/goods.php?id=972
  • AndricAndric Posts: 1
    edited 2010-02-16 22:16
    I have Sure electronics 0832 board, but can't connect it to Arduino. I use all required pins and upload sample from this forum (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439/0)
    May be someone can show simple code example for turn on any led?
    Thanks.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2010-02-22 19:47
    Andric,

    This forum is for the SX microcontroller not the Arduino. In particular this post is for the Sure Electronics 0832 and code used to connect to it. If you are looking for Arduino code, your best bet is to post a message on the Arduino site that you mentioned before. That posting link is very good and I have posted many 0832 questions in the past. As a mater of fact, it was because of their Arduino code that I was able to convert it into a working version for the SX microcontroller. I would specifically address your code comment on that site. The code is from Westfw and others like florinc. Florinc had a site that he had the entire Arduino code posted (not just in bits and pieces from your link). He is a good one to ask about the details (as well as generally to the entire forum members).

    However, if you do decide to go with an SX microcontroller (SX48 or SX28), I can help more then. I do have an Arduino board but don't know C well enough to do too much with it - at least for the moment.

    Good luck.
  • VylenVylen Posts: 1
    edited 2010-02-27 15:06
    Thread revival! Hope you don't mind [noparse];)[/noparse]

    In any case, I stumbled upon this thread when looking up information about the 0832.

    I myself have bought a red 0832 display (with 3 more on the way) as well as the demo board that Sure Electronics provides.

    Fortunately I got into this mess after they released a manual for it haha.

    Just wanted to share that the demo board can display text sent to it over USB and the 0832 displays only show 4 characters at a time (1 character per LED module). So it's comparatively inferior to what you got here.

    I wish I could write up my own code to use on the demo board (to fit more characters on), but I've got no clue - only ever messed with AVR and an ATMega64 dev board a couple years ago... The Sure Electronics demo board is a PIC16F723..

    For now I've just written a C program to tell the demo board what to display - turned it into a scrolling LED ticker... The program has an open UDP port, so other applications can send it stuff to display. Handy, but simple.

    Post Edited (Vylen) : 2/27/2010 3:13:24 PM GMT
  • TyshawnTyshawn Posts: 3
    edited 2010-03-19 11:19
    Holtek tells me that the PWM works on an individual pixel basis, so that you have 16 brightness levels for each pixel. However, the best that I can do is to set a PWM level for one entire panel. With four panels I can have 4 different brightness levels, but it doesn't seem to address anything smaller than an entire panel.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    TYSHAWN
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2010-03-19 12:14
    I have worked extensively with the Sure Electronics 0832 display and other related Sure Electronics LED displays.

    I have also built a custom RGB board that uses the Holtech HT1632C newest chip (very similar to the obsolete HT1632 that is used in the 0832 displays - but a couple of coding changes are needed).

    http://forums.parallax.com/showthread.php?p=867334

    Although I have not focused on these displays in a few months, I beleive it is possible to have individual PWM per LED since these boards are RAM based and controllable.

    See my code I have in the first·page·of this·post·and ask any questions. Other than yourself, I haven't seen much other development on this forum with the 0832 (at least not in posts). If you haven't seen this other Arduino thread, it also has some good information on the 0832 and Sure Electronic's 2416 (which is basically just another configuration of how the HT1632 or HT1632C can be used in LED outputs (either 32x8 or 24x16).
    http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439/210

    Post Edited (T&E Engineer) : 3/19/2010 7:10:50 PM GMT
  • xyzabcpqrxyzabcpqr Posts: 1
    edited 2012-04-13 14:30
    Hello all,

    I am currently working on 0832 sure electronics Led dot matrix display. I want to interface it with PIC 16F1937 . I am using MPLAB and Hi-Tech C compiler as a software platform.
    I write simple C code but nothing happened.
    My connections are as follows:

    PIC Pin 0832 pin

    RB1 - CS1
    RB2 - WR
    RB3 - DATA
    VCC OSC(Connected with Vcc)
    GND

    Here i am attaching my code.

    #include<htc.h>
    #include<pic.h>
    #include <math.h>


    #define SYS_OSC 0b01101010;




    __CONFIG( FOSC_INTOSC & WDTE_OFF & PWRTE_OFF & MCLRE_ON & CP_OFF & CPD_OFF &
    BOREN_OFF & CLKOUTEN_ON & IESO_OFF & FCMEN_OFF);


    __CONFIG( WRT_OFF & VCAPEN_OFF & PLLEN_OFF & STVREN_OFF & BORV_25 &
    LVP_OFF);


    #define CS TRISB1
    #define WR TRISB2
    #define DATA TRISB3


    #define CS_BIT LATB1
    #define WR_BIT LATB2
    #define DATA_BIT LATB3


    int i,j,k,address,comd,dataB,z;
    //unsigned char dataA[8];


    //void init();
    void Command_mode(unsigned char address);
    void Data_mode(unsigned char address);
    //void Display();


    /*
    dataA[0] = 0b00111100; //'start of "letter 'S'"
    dataA[1] = 0b00100000;
    dataA[2] = 0b00100000;
    dataA[3] = 0b00111100;
    dataA[4] = 0b00000100;
    dataA[5] = 0b00000100;
    dataA[6] = 0b00000100;
    dataA[7] = 0b00111100;
    */


    const unsigned char dataA[]= {0xaa}; // FOR LETTER 'M'


    void Data_mode(unsigned char address){


    CS_BIT = 0;


    // Data MODE ID


    comd = 0b00000101;
    for(k=0;k<3;k++){
    WR_BIT =0;
    _delay(1000);
    DATA_BIT = comd;
    _delay(1000);
    WR_BIT =1;
    comd = comd >> 1;
    _delay(1000);
    }
    // 7 BIT ADDRESS
    for(j=0;j<7;j++){
    WR_BIT =0;
    _delay(1000);
    DATA_BIT = address;
    _delay(1000);
    WR_BIT =1;
    address = address >> 1;
    _delay(1000);


    }


    for(i=0;i<8;i++)
    {
    WR_BIT =0;
    _delay(1000);
    DATA_BIT = dataB;
    _delay(1000);
    WR_BIT =1;
    _delay(1000);
    }
    CS_BIT = 1;


    }






    void Command_mode(unsigned char address){
    CS_BIT = 0;


    // COMMAND MODE ID


    comd = 0b00000100;
    for(k=0;k<3;k++){
    WR_BIT =0;
    _delay(100);
    DATA_BIT = comd;
    _delay(1000);
    WR_BIT =1;
    comd = comd >> 1;
    _delay(100);
    }
    // 7 BIT ADDRESS
    for(j=0;j<8;j++){




    WR_BIT =0;
    _delay(100);
    DATA_BIT = address;
    _delay(1000);
    WR_BIT =1;
    address = address >> 1;
    _delay(100);


    }
    // END BIT
    WR_BIT = 0;
    _delay(10);
    DATA_BIT =1;
    _delay(10);
    WR_BIT =1;
    //LAST send the endbitZ
    _delay(10);


    //All set! Now set CS to high
    CS_BIT = 1;


    }


    void Display(){
    address = 0x00;
    for(i=0;i<8;i++){
    dataB = dataA;
    Data_mode(0x00);
    address = address + 2;
    }
    }


    void init(){

    Command_mode(0b00000001); // turn on system oscillator
    Command_mode(0b00011000); // RC
    //_delay(1000);
    Command_mode(0b00000011); // TURN ON led outputs
    //_delay(1000);
    Command_mode(0b10101111); // PWM DUTY CYCLE 16/16
    //_delay(1000);
    Command_mode(0b00100000);
    //_delay(1000);


    }


    void main(){


    TRISB=0x00;
    ANSELB=0x00;
    OSCCON = SYS_OSC;




    init();


    Display();


    //while(1);
    }


    I am really confused where I am going wrong. Your corrections and suggestions are appreciated.

    Thanks in Advance.
  • ZootZoot Posts: 2,227
    edited 2012-04-13 22:14
    xyzabcpqr -- this is an SX microcontroller forum. You might want to try a PIC forum, an MPLAB forum and/or a C forum for help with your questions.
Sign In or Register to comment.