2005-09-22 09:01 PM
programming the control register (st7538)
2004-11-09 09:34 PM
Hi,
I use the ST7538 with the PIC16F877 from Microchip. My problem is to write the control register. I try to do the initialization in this way: .. RxTx = 0; REG_DATA = 1; spi_write(0b11101101); spi_write(0b10100001); spi_write(0b01100101); REG_DATA = 0; ... Everytime the frequency (MCLK / pin11) changes to 16MHz. I think it should be 8MHz according to my programming. The REG_OK pin is low. Who can help?2004-12-09 06:14 AM
Hi,
I could not use the PIC SPI in the ST7538 communication, instead, I made a interrupt function tied to an external pin (CLR/T). For writing operations, my interrupt is sensible to rising edge transitions, for reading operations, the interrupt is sensible to falling edge. Did this helped you someway? Rafael Krapf BRASIL2004-12-13 11:38 PM
Hi Rafael,
I tried it with the external interrupt (RB0-Interrupt), but the received message was wrong. Can you tell me more about your configurations (st7538 & yC)? Regards Thorsten2004-12-19 08:39 PM
2004-12-22 06:01 AM
Sorry for the response time! I am busy here :)
By the way, I am using B0 tied to CLRT ST7538 pin, when I am receiving, I set the interrupt for RISING edge by seting the bit 6 in the OPTION register. So when the interruption occurs I read the pin assigned to the data line, and put this data in my memory shift register. When I am sending data I CLEAR the bit 6 in the OPTION register, so, when interruption occurs, I set the desired data in the data line... This way, when the rising edge of CLRT occurs, the data is stable at data line. And there is time enought because the PLC speed is very slow (I am using a 10MHz crystal) :D :D Any further questions?2005-01-14 12:33 AM
Thanks for your answers!
I have now the problem that the received message is often shifted by one bit. Is it possible that the wiring causes this problem?2005-01-14 12:50 AM
Hi,
I had a problem very close to yours... How I debugged: With a scope and an extra output pin to work as debug pin, I wrote my state machine such a way as when one bit was received by the uC, the uC output to debug pin a signal (that I can check in the scope). This way, I found that I was counting 25 bits, not 24! :-Y Just because the way the state machine transitions were made. So I changed the state machine transitions implementation and all worked fine. Can you implement a debug scenario like mine? If so, and if you still have a free I/O pin in your uC I suggest this method. Let me know your results ;) Rafael Krapf BRASIL2005-01-17 10:00 PM
Hi,
I checked the programming with a oscilloscope. My problem is that there is a wrong synchronization (not constant) between the receiving message and the clock on clr/t-pin. :(2005-01-18 12:24 AM
Quote:
On 18-01-2005 at 11:30, chiptuner wrote: Hi, I checked the programming with a oscilloscope. My problem is that there is a wrong synchronization (not constant) between the receiving message and the clock on clr/t-pin. :( The scope never lies... If you do not follow the timing specification at page 12, figure 2 (in ST7538 datasheet) the programming will not work. Good luck!!! :D