Quantcast
Channel: Forums - Recent Threads
Viewing all 262198 articles
Browse latest View live

Cannot use I2C module and Uart Module simultaneously

$
0
0

Hi,

I am writing a program to display the data stored in EEPROM in UART terminal.Controller used by me is PIC32MX795F512L.

Communication between EEPROM(24aa01) and PIC32 is I2C.//Write a program to write the data to EEPROM.I am using MPLAB IDE v8.92.

Here is the code I wrote


#include<proc/p32mx795f512l.h>
//configure the system clock to 80MHz
#pragma config POSCMOD=HS,FNOSC=PRIPLL
#pragma config FPLLMUL=MUL_20
#pragma config FPLLIDIV=DIV_2
#pragma config FPLLODIV=DIV_1
#pragma config FWDTEN=OFF
#pragma config FPBDIV=DIV_2

//Enable the timer module to check whether the clock frequency is correct
void delay_ms(unsigned int d)
{unsigned int i;
for(i=0;i<d;i++)
{
PR1=313;
TMR1=0;

while(TMR1<PR1);

}
}

void Timer1_init()
{
T1CON=0;
T1CON=0X00008030;
}

//Enable I2C module
void I2C_Init(){
    I2C1CON = 0;
    I2C1BRG = 0x00c5 ; // 0x004f;

    //Now we will initialise the I2C peripheral for Master Mode, No Slew Rate
    //Control, and leave the peripheral switched off.
   
    I2C1CON = 0x1200;
   
    I2C1RCV = 0x0000;
    I2C1TRN = 0x0000;
    //Now we can enable the peripheral
   
    I2C1CON = 0x9200;}
void UART_Init()
{
U2MODEbits.BRGH=0;
U2BRG=21;
U2MODEbits.UEN=0X00;
U2MODEbits.SIDL=0;
U2MODEbits.IREN=0;
U2MODEbits.PDSEL=0X00;
U2MODEbits.STSEL=0X00;
U2STAbits.UTXEN=1;
U2STAbits.URXEN=1;
U2MODEbits.ON=1;
}

void UART_Tx(unsigned char read)
{while(U2STAbits.UTXBF);
U2TXREG=read;
//delay_ms(200);
}


//Write data to EEPROM

unsigned char Write_EEPROM(unsigned char i,unsigned char b)
{
char f;

while(I2C1STATbits.TRSTAT==1);
I2C1CONbits.SEN=1;
while(I2C1CONbits.SEN==1);

I2C1TRN=0xA0;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
f = I2C1STATbits.ACKSTAT;

I2C1TRN=i;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
f=I2C1STATbits.ACKSTAT;

I2C1TRN=b;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
f=I2C1STATbits.ACKSTAT;
//I2C1CONbits.ACKEN=1;
I2C1CONbits.PEN=1;
while(I2C1CONbits.PEN==1);
}
// Read data from EEPROM
unsigned char Read_EEPROM(unsigned char i)
{
unsigned char k,x;
while(I2C1STATbits.TRSTAT==1);
I2C1CONbits.SEN=1;
while(I2C1CONbits.SEN==1);

I2C1TRN=0xA0;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
k=I2C1STATbits.ACKSTAT;

I2C1TRN=i;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
k=I2C1STATbits.ACKSTAT;

while(I2C1STATbits.TRSTAT==1);
I2C1CONbits.RSEN=1;
while(I2C1CONbits.RSEN==1);

I2C1TRN=0xA1;
while(I2C1STATbits.TBF==1);
while(I2C1STATbits.TRSTAT==1);
k=I2C1STATbits.ACKSTAT;
I2C1CONbits.RCEN=1;
UART_Tx(I2C1RCV);
//UART_Tx(x);
while(I2C1STATbits.TRSTAT==1);
I2C1CONbits.PEN=1;
while(I2C1CONbits.PEN==1);

}

//MAIN PROGRAM
void main()
{
AD1PCFG=0xffff;
Timer1_init();
I2C_Init();
LATB = 0;
UART_Init();
TRISD=0;
LATDSET=0x00;
TRISB=0;
LATBSET=0x00;
unsigned char b;
unsigned char i;
while(1)
{
   LATB =0x00;
LATD=0;
 b = 0x00;
//  for(i = 0x00; i<0x100; i++) {
 Write_EEPROM(0x01,0xff);
  //  b++;
    delay_ms(5);
 // }
 // for(i = 0x00; i <0x100; i++){
 //  LATD = i;
  Read_EEPROM(0x01);
    delay_ms(100);
  //}
//while(1);
}
}

Individual modules are working fine.When I club both I receive unknown character.

Please help resolving this issue.

Regards,

Parimala


ADS7828: Reset I2cBus from ADS7828EB

$
0
0

Part Number: ADS7828

Hi I have a question about the ADS7828EB.

We have problems with our I2C bus in an existing project and would like to reset it hardware-wise.
We can switch off the 5V supply voltage of the bus for a short time. Now my question. If we switch off the 5V supply voltage, the reference voltage and the analog input signals (0V to 5V at 1 mA) would still be applied to the ADS7828EB. Would that be a problem for the ADS7828EB. Could one really reset the I2C bus driver of the ADS7828EB by removing the supply voltage?

Thank you very much for your help.

Many greetings

axel

Translated with www.DeepL.com/Translator

Compiler/AM6548: Prebuilt Image Does not use dtb for uboot

$
0
0

Part Number: AM6548

Tool/software: TI C/C++ Compiler

I am using SDK 6.0 launched recently by TI. I have flashed the SD card using Prebuilt images from SDK. I have boot the board I did not see any dtb being used by uboot in SD card. I wanted to change the DDR4 speed but it is part of dts and current uboot does not use dts.

DRA750: Disabling DSP clock frequency from Kernel

$
0
0

Part Number: DRA750

HI Ti Team,

We are facing an issue where Kernel is over writing "DSP frequency ( Register: CM_CLKSEL_DPLL_DS RW 32 0x0000 0140 0x4A00 5240 )"  which is setting by bootloader. We don't want to change frequency set by Bootloader. We see there is DTS entry where clock is set to 600MHZ.

        dpll_dsp_ck: dpll_dsp_ck {
                #clock-cells = <0>;
                compatible = "ti,omap4-dpll-clock";
                clocks = <&sys_clkin1>, <&dpll_dsp_byp_mux>;
                reg = <0x0234>, <0x0238>, <0x0240>, <0x023c>;
                assigned-clocks = <&dpll_dsp_ck>;
                assigned-clock-rates = <600000000>;
        };


 we are modifying  the DTS entry by excluding the register 0x240 and by this clock frequency remains untouched . Could you please let us know is this the correct way of doing or if any please let us know.

Patch:

diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi
index b9ac7ea..04cf0db 100644
--- a/arch/arm/boot/dts/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -337,7 +337,8 @@
                #clock-cells = <0>;
                compatible = "ti,omap4-dpll-clock";
                clocks = <&sys_clkin1>, <&dpll_dsp_byp_mux>;
-               reg = <0x0234>, <0x0238>, <0x0240>, <0x023c>;
+               /*reg = <0x0234>, <0x0238>, <0x0240>, <0x023c>;*/
+               reg = <0x0234>, <0x0238>, <0x023c>;
                assigned-clocks = <&dpll_dsp_ck>;
                assigned-clock-rates = <600000000>;
        };

Thanks and Regards,

Vivek

TPS61088: TPS61088 Circuit No Output,Test IC Finds Short Circuit between 4th(SW) and 8th(BOOT) Legs

$
0
0

Part Number: TPS61088

Product parameters          
 Input: 3-4.2V            
Output: 6V 1A            
TPS61088 Circuit No Output            
Test IC Finds Short Circuit between 4th(SW) and 8th(BOOT) Legs 

What is the Minimum on-time duty cycle supported by TPS61088 

What is the minimum duty cycle supported by TPS61088

TPS25940-Q1: TPS25940-Q1 for Voltage Protection

$
0
0

Part Number: TPS25940-Q1

Hello,

I am going to use IC TPS25940AQRVCRQ1 for my upcoming Automotive Product.

Here the working voltage of my Design is 10V-16V (Typ-12V).

I am converting 5V and 3.3V from 12V and 3.3V is going to the MCU.

As the requirement also says that when the input voltage is vary from 6V to 32V, the MCU will work at 6V input condition and there is no any damage during 32V input.

IC TPS25940AQRVCRQ1 will work 2.7V to 18V.

Incase of 6V input, it is work but how can I handle 32V input?

Rehards,

Alpesh.

CDCI6214: Datasheet Questions

$
0
0

Part Number: CDCI6214

(Please visit the site to view this file)

Hello,

Could you please answer datasheet questions on the attached word file?

Regards,

Itoh

TS5MP646: Can I used two TS5MP646 cascade(serial) for C-PHY v1.0 (2.5Gsps) application?

$
0
0

Part Number: TS5MP646

Hi Sirs:

Can I used two TS5MP646 cascade(serial) for C-PHY v1.0 (2.5Gsps) application? Why? Or what is necessary to be cared?

Thanks!

Best regards,

Freeman


AMC3301: AMC3301 inquiry

$
0
0

Part Number: AMC3301

Hello Support team,

I have some questions.

*Radiated EMI test data of AMC3301

*Maximum output current for external application on DCDC

Thanks,

Koji Ikeda

DS160PR410: 8channel solution

$
0
0

Part Number: DS160PR410

Hi Sir 

Our customer would to PR410 and PR800 (8channel) mass product date ,Please kindly help to reply 

Thanks

CC3100: Listening On port 80 - Error

$
0
0

Part Number: CC3100

Hello,

i got a cc3100. If im am listening to Port 80, the function SL_Listen returns the error -22, port 8080 is running well. The Device is in Acess point Mode.

Anyone got a solution for this Problem?

PMP21735: Reference design transformer parameters

$
0
0

Part Number: PMP21735

Hello!

I am planning on using PMP21735 reference design although I can`t find info about transformer used in reference design (PM2522NL).

Can anyone provide possible alternatives or at least transformer specification?

MUX36S08: Schematic review about the application of MUX36S08

$
0
0

Part Number: MUX36S08

Hi Team,

Customer wants to use MUX36S08 to change the gain of amplifier, please take your time to review the schematic and give some suggestions to possible issues. This is a great chance for our MUX36S08 and OPA2196.

Below is the detailed schematic, the exact number of amplifier is OPA2196.

Best Regards,

Stanley Dai.

BOOSTXL-DRV8301: BOOSTXL-DRV8301 - Arduino Support

$
0
0

Part Number: BOOSTXL-DRV8301

Good Morning,

I was wondering whether it would be possible to use an Arduino Uno to control a BLDC through the DRV8301?

I'm fairly new to electronics and electrical engineering and am struggling to understand which ports on the base of the DRV8301 need to be connected to the Arduino.

Any help is very much appreciated.

PROCESSOR-SDK-AM65X: Template application workshop issues

$
0
0

Part Number: PROCESSOR-SDK-AM65X

Hello,

While working through the 9.1. Template Application Workshop using the AM65x IDK  I am finding the projects won't build.

I am using the latest CCS & RTOS SDK and have checked for updates from within CCS: 

CCS9.1.0.00010_linux-x64.tar.gz and ti-processor-sdk-rtos-am65xx-evm-06.00.00.07-Linux-x86-Install.bin

The Projects are:

project baremetal_template_app_am65xx_a53

project rtos_template_app_am65xx_a53

(Please visit the site to view this file)

I have attached a build log for both Projects project baremetal_template_app_am65xx_a53

 

It seems the compiler options are not correct of the wrong Architecture for compiler is being used, not that for the arm8 A53,

Below are the unrecogniszed Arguments....

arm-none-eabi-gcc: error: unrecognized argument in option '-mcpu=cortex-a53+fp+simd'

arm-none-eabi-gcc: error: unrecognized argument in option '-mabi=lp64'

Any help with getting These templates to work on the AM65x would be gratefully recieved.

Best regards

John Bebbington.


SN75LVDS83B: SN75LVDS83B 24bit Format2 setting

$
0
0

Part Number: SN75LVDS83B

Hi Team, 

My customer is using the SN75LVDS83B for the RGB - LVDS solution. 

And they're using the FORMAT 2 of the 24-bpp LCD display mode.

I checked the wire connecting is all right but don't find any instruction on how to set the format 2 rather than format 1 for the 24-bit mode in the datasheet. 

Right now there's some problem with the color display, but the content is all right. 

So I'm wondering how this device know it should be working in the FORMAT 2 of 24-bit mode? Any hardware or software setting is needed? 

 

TPS92075: Dimmer of TPS92075

$
0
0

Part Number: TPS92075

Dear Texas,

our cutomer ha requested an application in which we need to change on the fly the power of a led string. Is there any way to change from a microprocessor (not isolated) to output power of the leds using TPS92075?

The only way is by adding a triac or is there any other simpler way? I don't want top use a triac before it. Or should I use other IC? The requested power at full power is 25W.

Thanks,

Cristian

CCS/MSP430FR5994: FFT Calculation

$
0
0

Part Number: MSP430FR5994

Tool/software: Code Composer Studio

Dear team,

I am using the following example code and MSP430FR5994.

But i felt confused with this example. Could anyone tell me how to FFT Calculation in this example?

Please tell me more information about this example.

BR,'

Susan

DS90CR216: Alternative DS90CR216

$
0
0

Part Number: DS90CR216

Hi App engineer 

Customer is thinking use DS90CR216

But DS90CR216 is NRND

Do we have Alternative promotion against above device?

Thank you for your kind help

Best  

TM4C123BE6PM: UARTCTL.RXE bit operation and a corruption of RX data

$
0
0

Part Number: TM4C123BE6PM

Hello,

My customer uses UART 6 for RS485 communication.

The UART port RX data have a problem. The port receives unexpected bytes when no one on RS485 bus is sending data.

To solve the unexpected bytes, they added a code to turn-on/-off the UARTCTL.RXE bit.

As a result, they found a side effect. The received values have started to be corrupted.

 

They want to investigate why the RXE bit operation induced the corruption of the receive data, and asked me the following questions.

Could you please advise?

 

[Q1]

My customer concerns that Setting/Clearing UARTCTL.RXE bit brings a change of U6RX pin impedance or voltage.

Do you agree this? If you agree, could you please how much the impedance and voltage changes ?

 

[Q2]

Could you please advise how long it takes, from setting UARTCTL.RXE bit to get ready to receive data ?

 

[Q3]

Could you please advise how long it takes, from clearing UARTCTL.RXE bit to ignore a new byte?

 

Viewing all 262198 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>