USMI

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » USMI » MCU, SoC, CPU Микроконтроллеры » JL SoC. 杰理芯片


JL SoC. 杰理芯片

Сообщений 1141 страница 1160 из 1317

1141

Полез сейчас на Али, а там почти все производители модулей переехали на чипы с логотипом AB (ну, или А3). Шо это такое?

1142

DeCadanz написал(а):

Полез сейчас на Али, а там почти все производители модулей переехали на чипы с логотипом AB (ну, или А3). Шо это такое?

Bluetrum SoC

1143

Midhun M P написал(а):

Thank You for your help.
Time means duration.

I have got another issue.

I have interface 16x2 lcd display (Hitachi’s HD44780) with this JLAC692 dev kit.

I added the c files and header files for this display to the SDK source code. ( The source code for LCD written by myself using bit bang)

I called the print function on the lcd.c file that i added from my main function

My main function is called by below method,

LOOP_DETECT_REGISTER(delay_1s ) =
{
    .time = 100,
    .fun  = main_function,
};

Now the LCD display is working. But when i play sounds through Bluetooth/usb/fm the sound get clipped. I thing it would be the timing issue on the OS.

My question is anyway to update my LCD data without affecting the playback functionality ?

Anybody could please help me ?

..................................................................................................................................................................
My main function is given below
..................................................................................................................................................................

void main_function()
{
  u8 IR_data = 0xff;
// LED_INIT_EN();
//  puts("\nWELCOME............MPZME...............................\n");

  LCD_clear_home();
  LCD_goto(1, 0);
  LCD_putstr("mpzzzzz");

  printf("0x%X",(u8)ir_code.wData);
  if ((u8)ir_code.wData == 0x6)
  {
      task_post_msg(NULL, 1, MSG_VOL_UP);
      ir_code.wData = 0xFF;
  }

}

..................................................................................................................................................................

My lcd.c file is given below
..................................................................................................................................................................

void LCD_init(void)
{

// delay(1632350); // 10ms

      LCD_RS_EN();
      LCD_EN_EN();
      LCD_DB4_EN();
      LCD_DB5_EN();
      LCD_DB6_EN();
      LCD_DB7_EN();

      LCD_RS_HIGH;
      LCD_EN_HIGH;
      LCD_DB4_HIGH;
      LCD_DB5_HIGH;
      LCD_DB6_HIGH;
      LCD_DB7_HIGH;

// delay(1632350); // 100ms

toggle_EN_pin();

LCD_RS_LOW;

LCD_DB7_LOW;
LCD_DB6_LOW;
LCD_DB5_HIGH;
LCD_DB4_HIGH;

toggle_EN_pin();

LCD_DB7_LOW;
LCD_DB6_LOW;
LCD_DB5_HIGH;
LCD_DB4_HIGH;

toggle_EN_pin();

LCD_DB7_LOW;
LCD_DB6_LOW;
LCD_DB5_HIGH;
LCD_DB4_HIGH;

toggle_EN_pin();

LCD_DB7_LOW;
LCD_DB6_LOW;
LCD_DB5_HIGH;
LCD_DB4_LOW;

toggle_EN_pin();

LCD_send((_4_pin_interface | _2_row_display | _5x7_dots), CMD);
LCD_send((display_on | cursor_off | blink_off), CMD);
LCD_send(clear_display, CMD);
LCD_send((cursor_direction_inc | display_no_shift), CMD);
}

void LCD_send(unsigned char value, unsigned char mode)
{
switch(mode)
{
    case DAT:
    {
    LCD_RS_HIGH;
    break;
    }
    case CMD:
    {
    LCD_RS_LOW;
    break;
    }
}

LCD_4bit_send(value);
}

void LCD_4bit_send(unsigned char lcd_data)
{
unsigned char temp = 0;

temp = ((lcd_data & 0x80) >> 7);

switch(temp)
{
    case 1:
    {
    LCD_DB7_HIGH;
    break;
    }
    default:
    {
    LCD_DB7_LOW;
    break;
    }
}

temp = ((lcd_data & 0x40) >> 6);

switch(temp)
{
    case 1:
    {
    LCD_DB6_HIGH;
    break;
    }
    default:
    {
    LCD_DB6_LOW;
    break;
    }
}

temp = ((lcd_data & 0x20) >> 5);

switch(temp)
{
    case 1:
    {
    LCD_DB5_HIGH;
    break;
    }
    default:
    {
    LCD_DB5_LOW;
    break;
    }
}

temp = ((lcd_data & 0x10) >> 4);

switch(temp)
{
    case 1:
    {
    LCD_DB4_HIGH;
    break;
    }
    default:
    {
    LCD_DB4_LOW;
    break;
    }
}

toggle_EN_pin();

temp = ((lcd_data & 0x08) >> 3);

switch(temp)
{
    case 1:
    {
    LCD_DB7_HIGH;
    break;
    }
    default:
    {
    LCD_DB7_LOW;
    break;
    }
}

temp = ((lcd_data & 0x04) >> 2);

switch(temp)
{
    case 1:
    {
    LCD_DB6_HIGH;
    break;
    }
    default:
    {
    LCD_DB6_LOW;
    break;
    }
}

temp = ((lcd_data & 0x02) >> 1);

switch(temp)
{
    case 1:
    {
    LCD_DB5_HIGH;
    break;
    }
    default:
    {
    LCD_DB5_LOW;
    break;
    }
}

temp = ((lcd_data & 0x01));

switch(temp)
{
    case 1:
    {
    LCD_DB4_HIGH;
    break;
    }
    default:
    {
    LCD_DB4_LOW;
    break;
    }
}

toggle_EN_pin();
}

void LCD_putstr(char *lcd_string)
{
do
{
    LCD_send(*lcd_string++, DAT);
}while(*lcd_string != '\0');
}

void LCD_putchar(char char_data)
{
LCD_send(char_data, DAT);
}

void LCD_clear_home(void)
{
LCD_send(clear_display, CMD);
LCD_send(goto_home, CMD);
}

void LCD_goto(unsigned char x_pos, unsigned char y_pos)
{
if(y_pos == 0)
{
    LCD_send((0x80 | x_pos), CMD);
}
else
{
    LCD_send((0x80 | 0x40 | x_pos), CMD);
}
}

void toggle_EN_pin(void)
{
LCD_EN_HIGH;

delay(16323); // 1ms
LCD_EN_LOW;
    delay(16323); // 1ms
}

.................................................................................................................................................................
My lcd.h file is given below
..................................................................................................................................................................

#ifndef _LCD_H
#define _LCD_H

#define LCD_C_PORT      JL_PORTC
#define LCD_DB7          (BIT(5))

#define LCD_B_PORT JL_PORTB
#define LCD_RS (BIT(5))
#define LCD_EN (BIT(4))
#define LCD_DB4 (BIT(3))
#define LCD_DB5 (BIT(1))
#define LCD_DB6 (BIT(2))

#define LCD_RS_EN() do{LCD_B_PORT->PU &= ~LCD_RS;LCD_B_PORT->PD &= ~LCD_RS;LCD_B_PORT->DIR &= ~LCD_RS;}while(0)
#define LCD_EN_EN() do{LCD_B_PORT->PU &= ~LCD_EN;LCD_B_PORT->PD &= ~LCD_EN;LCD_B_PORT->DIR &= ~LCD_EN;}while(0)

#define LCD_DB4_EN() do{LCD_B_PORT->PU &= ~LCD_DB4;LCD_B_PORT->PD &= ~LCD_DB4;LCD_B_PORT->DIR &= ~LCD_DB4;}while(0)
#define LCD_DB5_EN() do{LCD_B_PORT->PU &= ~LCD_DB5;LCD_B_PORT->PD &= ~LCD_DB5;LCD_B_PORT->DIR &= ~LCD_DB5;}while(0)
#define LCD_DB6_EN() do{LCD_B_PORT->PU &= ~LCD_DB6;LCD_B_PORT->PD &= ~LCD_DB6;LCD_B_PORT->DIR &= ~LCD_DB6;}while(0)
#define LCD_DB7_EN() do{LCD_C_PORT->PU &= ~LCD_DB7;LCD_C_PORT->PD &= ~LCD_DB7;LCD_C_PORT->DIR &= ~LCD_DB7 ;}while(0)

//#define LCD_GPIO_init() do{P00_PushPull_Mode; P01_PushPull_Mode; P10_PushPull_Mode; P11_PushPull_Mode; P12_PushPull_Mode; P13_PushPull_Mode;}while(0)

#define LCD_RS_HIGH do{LCD_B_PORT->OUT |= LCD_RS;}while(0)
#define LCD_RS_LOW do{LCD_B_PORT->OUT &= ~LCD_RS;}while(0)

#define LCD_EN_HIGH do{LCD_B_PORT->OUT |= LCD_EN;}while(0)
#define LCD_EN_LOW do{LCD_B_PORT->OUT &= ~LCD_EN;}while(0)

#define LCD_DB4_HIGH do{LCD_B_PORT->OUT |= LCD_DB4;}while(0)
#define LCD_DB4_LOW do{LCD_B_PORT->OUT &= ~LCD_DB4;}while(0)

#define LCD_DB5_HIGH do{LCD_B_PORT->OUT |= LCD_DB5;}while(0)
#define LCD_DB5_LOW do{LCD_B_PORT->OUT &= ~LCD_DB5;}while(0)

#define LCD_DB6_HIGH do{LCD_B_PORT->OUT |= LCD_DB6;}while(0)
#define LCD_DB6_LOW do{LCD_B_PORT->OUT &= ~LCD_DB6;}while(0)

#define LCD_DB7_HIGH do{LCD_C_PORT->OUT |= LCD_DB7;}while(0)
#define LCD_DB7_LOW do{LCD_C_PORT->OUT &= ~LCD_DB7;}while(0)

#define clear_display 0x01
#define goto_home 0x02

#define cursor_direction_inc (0x04 | 0x02)
#define cursor_direction_dec (0x04 | 0x00)
#define display_shift (0x04 | 0x01)
#define display_no_shift (0x04 | 0x00)

#define display_on (0x08 | 0x04)
#define display_off (0x08 | 0x02)
#define cursor_on (0x08 | 0x02)
#define cursor_off (0x08 | 0x00)
#define blink_on (0x08 | 0x01)
#define blink_off (0x08 | 0x00)

#define _8_pin_interface (0x20 | 0x10)
#define _4_pin_interface (0x20 | 0x00)
#define _2_row_display (0x20 | 0x08)
#define _1_row_display (0x20 | 0x00)
#define _5x10_dots (0x20 | 0x40)
#define _5x 7_dots (0x20 | 0x00)

#define DAT 1
#define CMD 0

void LCD_init(void);
void LCD_send(unsigned char value, unsigned char mode);
void LCD_4bit_send(unsigned char lcd_data);
void LCD_putstr(char *lcd_string);
void LCD_putchar(char char_data);
void LCD_clear_home(void);
void LCD_goto(unsigned char x_pos, unsigned char y_pos);
void toggle_EN_pin(void);

#endif

Anybody could help me ?

1144

Midhun M P написал(а):

{
LCD_EN_HIGH;

delay(16323); // 1ms
LCD_EN_LOW;
    delay(16323); // 1ms
}

Maybe here problem? Try comment out this part of code, and see what happened.

Подпись автора

By Admin

1145

Or better, add printf function everywhere (in all steps, init, check , buffer send/read) , step by step, and turn on debug UART in cfg file.

Подпись автора

By Admin

1146

And say more about your problem..

Подпись автора

By Admin

1147

That was my concern, too. With such delays your LCD functions may take a several hundreds of milliseconds to complete (for the functions that print something on screen), and since all "loop detect" functions run from the timer ISR, they block any other system activity, so ideally they should run in a shortest possible time. An equivalent of, say, 10 microseconds should work fine.

Also, since you asked about how to get the song name and the playtime, maybe you should consider integrating your LCD code into the existing UI subsystem; here you can also find code you need to get the song name, playtime, file number and whatnot.

Подпись автора

水Mizu-DEC JLtech since 22.06.2019

1148

BIOS написал(а):

Maybe there's a problem here? Try comment out this part of code, and see what happened.

When i comment this code, music is working fine without any clipping. But the lcd is not working. I reduced the delay value upto 10000 ( delay(10000); ) , the lcd works fine but audio is clipping. below 10000 ( delay (<10000), lcd is not working but audio is okay

1149

kagaimiq написал(а):

That was my concern, too. With such delays your LCD functions may take a several hundreds of milliseconds to complete (for the functions that print something on screen), and since all "loop detect" functions run from the timer ISR, they block any other system activity, so ideally they should run in a shortest possible time. An equivalent of, say, 10 microseconds should work fine.

Also, since you asked about how to get the song name and the playtime, maybe you should consider integrating your LCD code into the existing UI subsystem; here you can also find code you need to get the song name, playtime, file number and whatnot.

Okay.

Then how can i implement this LCD functions ?

Any way to implement my own code without loop detecting registers ?

1150

BIOS написал(а):

Or better, add printf function everywhere (in all steps, init, check , buffer send/read) , step by step, and turn on debug UART in cfg file.

Hi Sir

I just write a printf

Please look on the below code snippet

void main_function()
{
  u8 IR_data = 0xff;
// LED_INIT_EN();
//  puts("\nWELCOME............MPZME...............................\n");

  LCD_clear_home();
  LCD_goto(1, 0);
  LCD_putstr("hello lcd");

  printf("\r\ntest.........................................."); ////////////// printf i wrote
// printf("0x%X",(u8)ir_code.wData);

  if ((u8)ir_code.wData == 0x6)
  {
      task_post_msg(NULL, 1, MSG_VOL_UP);
      ir_code.wData = 0xFF;
  }

}

I can see the printf log on my uart console.

1151

BIOS написал(а):

{
LCD_EN_HIGH;

delay(16323); // 1ms
LCD_EN_LOW;
    delay(16323); // 1ms
}

Im mean, if it just pin enable lcd? If yes - just comment out this part of code, and connect this pin LCD_EN to VCC or GND hardrdware.Keep the display always on...

Подпись автора

By Admin

1152

BIOS написал(а):

Im mean, if it just pin enable lcd? If yes - just comment out this part of code, and connect this pin LCD_EN to VCC or GND hardrdware.Keep the display always on...

Hi

Its not fully on every time. Not for enable lcd

EN pins are typically used in conjunction with a microcontroller or other device to control the display content on the LCD. The microcontroller sends commands or data to the LCD by setting appropriate signals on these pins. The "en" pin, specifically, is toggled to indicate to the LCD that data is ready to be read or written. This pin is often pulsed to signal the LCD module to latch in the data present on the data pins

1153

Try use timer #2 to make delay. (Timer 1 its SYS tick timer)

Подпись автора

By Admin

1154

BIOS написал(а):

Try use timer #2 to make delay. (Timer 1 its SYS tick timer)

Hi

You mean to use timer 2 for make delay ?

1155

right

Подпись автора

By Admin

1156

BIOS написал(а):

right

Hi

After using timer 2 for delay, i have solved my problem.

Thank You guys............Thanks a lot

1157

hi, i found gg drive link of AC695X on page 1, but it seems the ggdrive folder is empty. Can you please check it! Thanks so much

1158

К стыду своему так и не нашел как перевести bluetooth в режим моно. Или на выходе DAC получить смикшированный из двух стереоканалов сигнал. Надо прицепить BT приемник на AC69xx к монофонической колонке, а как это сделать я ХЗ совершенно.

Отредактировано Alcest (2024-04-01 22:01:20)

1159

Alcest написал(а):

Или на выходе DAC получить смикшированный из двух стереоканалов сигнал.

За это должна отвечать опция "DAC_SOUNDTRACK_COMPOUND" в sdk_cfg.h

Подпись автора

水Mizu-DEC JLtech since 22.06.2019

1160

https://forumupload.ru/uploads/001b/ca/8a/87/t667621.jpg

Do you think there is a way to write a general command instead of the drive volume, so that they can be read with just one click!,without write the drive name?


Вы здесь » USMI » MCU, SoC, CPU Микроконтроллеры » JL SoC. 杰理芯片