Unable to program Atmega128 - embedded

I am using ATMEGA128L on development board. I am trying to program it using an AVR serial ISP with the help of WinAVR. The changes that i made in makefile are as follows. MCU-atmega128 , programmer-avrisp, port-COM1 ( The port which has been assigned by pc ).The development board is getting proper dc power supply as the default program loaded by the vendor in it is running properly.The error that i am getting is "avrdude: stk500_getsync(): not in sync: resp=0x00"The connections between programmer and micro-controller are as follows.
connections between programmer and microcontroller
programmer -- microcontroller
MOSI --- PE0
MISO -- PE1
SCK -- SCK(PB1)
RST -- RST of board
VCC -- VCC of Dev board
GND -- GND of dev board

Related

How to transfer data of UART(RS-422) to I2C pins on dsPIC33EV128GM006?

I'm using MPLAB X IDE to implement the transfer of UART data to I2C bus on dsPIC33EV128GM006 using interrupts. How should I start the data transfer if I'm not using the EEPROM or bridge converter IC?
For UART: Port PINS G6 and G7 are being used for communication.
FOR I2C: Port PINS SCL1 and SDA1 are being used for communication.
Baud rate: 9600
Crystal frequency = 32 MHz
The basic goal is to echo the signal from UART to I2C bus to know what data was sent or received on the UART bus.
Working part: UART is working fine with sending characters/strings. I2C is also working fine.
Please let me know the basic logic/approximate flow to implement the goal.

Bootloader access over CANBUS on Nucleo-F446RE

I am trying to flash code over CANBUS on Nucleo-F446. I am referring this application notes
https://www.st.com/resource/en/application_note/cd00264321-can-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf
So according to it in Boot mode the default baud rate of CAN is 125KBPS and we need to use PB5 and PB13 pin which are CAN2 pins.
For testing I tried to send CAN message with DLC=0 and STDID = 0x79 for which STM32 should return a ACK with same ID i.e. 0x79.
But I am not getting any response.
You must add a external clock to your Nucleo Board
The system clock is derived from the embedded internal high-speed RC for USARTx and
I2Cx bootloaders. This internal clock is also used for CAN and DFU (USB FS Device) but
only for the selection phase. An external clock multiple of 1 MHz (between 4 and 26 MHz) is
required for CAN and DFU bootloader execution after the selection phase.
STM Bootloader Description

Labview CY7C68013A-56 USB Microcontroller High-Speed USB Peripheral Controller

i need to konw how to make labview get data from "CY7C68013A-56 USB Microcontroller High-Speed USB Peripheral Controller" which is connectoed to xilinx spartan 6
the general setup is displayed in http://www.cypress.com/file/44551/download on page 2 ( source code is on http://www.cypress.com/documentation/application-notes/an61345-designing-ez-usb-fx2lp-slave-fifo-interface )
FX2LP Code Architecture
The firmware configures auto mode for both the IN and OUT endpoint FIFOs.
This means that the packets are committed automatically from the
external peripheral to the USB domain for IN transfers and
vice versa for OUT transfers. The 8051 CPU is not involved in
committing packets. Refer Slave FIFOs chapter in EZ - USB
Technical Reference Manual to get more details on configuration of
endpoint FIFOs in auto or manual mode. As bulk transfers are being
used in this application, you need to configure the endpoints as Bulk.
But based on the end application you can configure endpoint type as
Interrupt, Control, or Isochronous in the USB descriptor file.
so you can get the data from the fpga directly via the USB endpoints EP2 (OUT) and EP6 (IN) of the FX2LP via bulk transfer
important is page 3 of http://www.cypress.com/file/44551/download because there is information about how to configure the FX2LP, pages 10 to 23 are also important, what is done with the program USB Control Center there has to be reproduced with labview
for this you have to connect labview to the endpoints, EP2 as OUT ( from labview pc to FX2LP ) and EP6 as IN ( from FX2LP to labview pc ) as bulk transfer
this is done by NI-VISA, details are in
http://www.cypress.com/forum/psoc-3-known-problems-and-solutions/interfacing-psoc-fx2lp-labview-using-ni-visa-drivers <---
http://www.ni.com/tutorial/4478/de/ <---
http://zone.ni.com/reference/en-XX/help/370131S-01/ni-visa/usingnivisatocommunicatewithyourusbdevice/
http://digital.ni.com/public.nsf/allkb/400D6EAB5CFE1C6B86257395005F5D48
you have to configure the FX2LP correctly and get the VID ( vendor id ) and PID ( product id ) of your FPGA and modify the driver with it
( http://www.cypress.com/file/126446/download ( http://www.cypress.com/documentation/technical-reference-manuals/ez-usb-technical-reference-manual )
( in http://www.cypress.com/documentation/application-notes/an4053-streaming-data-through-isochronous-or-bulk-endpoints-ez-usb is a pc application for USB bulk transfer ( not labview ) )

stm32f3 'USER USB' not detected

I'm working on stm32f3 discovery board. For my current project I planned on coding a simple UART program on the board, I happened to read somewhere on the internet that to use the board for UART communication with PC the 'USER USB' has to be used.
My questions are the following
Firstly when i connect my board to PC using the 'USER USB'. The PC refuses to recognize the board.(F.Y.I- OS used is windows 7 64bit). This problem persists even after I update the driver! How to resolve this?
Is the "Connecting USER USB" part correct? because I can't see any RS232 chip on board
Should I use an add on board?
P.S I've installed all the necessary drivers from ST website and works flawlessly while using 'ST-Link interface' part of the board
I started working with the STM32F3 disco a few weeks ago. The user USB thing is a bit tricky.
To get it clear: The board has 2 USB ports.
One mostly for programming and debugging. It connected to a second ST chip which works as programming adapter.
The seconds (called USER USB) is connected to the STM32F303 chips you program
So what you can do is to configure your STM32 to implement a CDC over USB. With the windows driver installed (automatic or from ST, depends on OS version) you should get a virtual com port in your device manager. If you don't have the driver, you also get a device labeled as virtual com port but with a yellow exclamation mark.
So if I get you question right, this is what you're trying to do? Then yes, "Connecting USER USB" is correct. No, you don't need an extension board.
How to resolve that? It depends:
Do you already see the device in your device manager as communication device or serial interface or something? Then only the CDC driver from ST is missing.
Or do you get an "Unknown Device" in your device manager? That is what I experienced.
In STM32CubeMX you need to enable the USB device (Peripehrals->USB)
In STM32CubeMX you need to select the USB stack (MiddleWares->USB_DEVICE->Communication Device Class)
Generate the code. If you are using HSI as clock source CubeMX will generate a error message you can ignore for now. For a real product you should use an external clock.
Note that there is a bug in CubeMX version 4.20. The code generator generates code which may not work if you select HSE as clock input source. Even if you go back to HSI, the error remains.
Compile an run the code. You maybe need to reset the board removing BOTH USB plugs
Windows should detect the board now.
Extra problem: The board is ... well. Tricky. If you only plug in the USER USB to your PC, it should work but Windows may also inform you that you have an UNKNOWN DEVICE because enumeration has failed.
Remove the plug again. Now, first plug in the other, ST-LINK USB to power on the board. Wait 1-2 seconds. Now plug in the USER USB. There seems to be a startup problem. Only using the USER USB for power supply and CDC seems to run in a race condition between boot and USB and USB enumeration fails. First powering the board and then plugging in removes this race condition (at least at my board)
Now Windows should enumerate the device and offer you a virtual com port. Actually you should get two of them: One "ST... STLink Virtual COM Port" and one "ST... Virtual COM Port". The seconds one is the one you are looking for.
I hope that was the answer on the question you had.
Thanks for the post, had the same issue, here is what I added
Approach: Turn-off USB lines programmatically by changing input to output, forcing it to zero and reenable them after around 1 second
Also used power-off and on from ST USB Libs
// Force Re-Enumeration by the USB Host
//
int aux_retrigger_usb()
{
GPIO_InitTypeDef GPIO_InitStructure;
// ST USB Function
PowerOff();
// Program Pin 12 USB_DP from Input to Output
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStructure);
// Set USB_DP to 0
GPIOA->BRR |= GPIO_Pin_12 ;
// Wait for for minimum 32* 50msec , 1,6 secs
while(tim3_cnt%32!=0) ; while(tim3_cnt%32!=31) ;
// ST USB Functions
PowerOn();
USB_Init();
Virtual_Com_Port_Reset() ;
// Program Pin 12 USB_DP from Output to input
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStructure);
return 1 ;
}
So basically to avoid the power on race condition, the ports may be programmed
first to outputs and then released after 1 second.
I'm also struggling with the STM32F302. The USB is not recognized by the HUB Down stream port, and therefore does not appear in a device manager on PC(HUB's upstream port is connected to PC).
So, I made a deep search after I checked all the HW and SW.
It appears that 1.5Kohm resistor should be added on a DP, as F302 does not have the embedded one.
My design does not have neither, so hopefully, it will solve the issue tomorrow, so I have a hope for tonight)
You can read AN4879 by ST - the place I found these directions.

How to configure ADE7953 metering IC

I am working with ADE7953 metering IC and I use the uart serial communication in raspberry pi to communicate with the IC and i have wiring pi installed in it.Can anyone help me regarding how to configure the IC.
You need to check the datasheets and look for the MODE register configuration. Also take care for the active energy line cycle accumulation mode registers to set before you take IRMS or VRMS any of the ENERGY register
The ADE7953 contains a detection system that automatically
detects which of the three communication interfaces is being
used.
The CS pin (Pin 28) is used to determine whether the
communication method is SPI. The pin must be low
during the SPI communication for this interface method.
The CS pin is active low and will automatically lock onto
SPI communication as a result.
The SCLK pin (Pin 25) is used to determine whether the
communication method is I2
C or UART. If this pin is held
high, the communication interface is set to I
2
C; if it is held
low, the communication interface is set to UART.
Now, for UART should be configured in hardware as pin28 should be high, pin25 should be low, pin 27 Rx and pin 26 Tx