Quartus 18 IP Error - quartus

I am currently trying to use Quartus 18.0 IP Catalog suggestions to import a UART RS-232 block to set up this serial interface.
I have set the clock domain and the output pin (using datasheet to DE0-CV board) but when I try to finish the UART setup by pressing "Generate HDL..." I get this error:
Error: rs232_0: The input clock frequency must be known at generation time.
How can I tell Quartus my clock frequency so that it could generate my UART module without errors?

You need to specify a clock source for the UART component you want to create.
This can be done as follow:
In your IP Parameter editor go under Edit > Add...
In the Add instance windows, search for Clock and select "Clock Source" under "Clocks; PLLs and Resets"
Add the Clock and update the default frequency and clock Finish
Go to View > Connections in IP Parameter editor
Tick the boxes to connect the clocks together
Generate and finish should stop giving you an error.
Qsys (under Tools > Platform Designer) maybe easier for the connections, maybe you can also have a look at it.

Related

Bluetooth HC-05 module

I have two HC-05 modules the first one's role as a Master and the other is a slave one.
I've done some AT commands to set up each HC-05 module
= Master's configuration has to be like that: name=Master, Password=2021, only accept connection from one HC-05 module only (for privacy purposes) via the Slave's Address, Baud rate = 9600,0,0.
= Slave's configuration has to be like that: name=Slave, Password=2021, Baud rate = 9600,0,0.
The AT command I used to set this configuration like that:
Slave:
/*Set Slave mode.*/
AT+ROLE= 0
/*Setting up Baud rate (The same as the Master Baud Rate to proper connection).*/
AT+UART= 9600,0,0
/*Rename the module.*/
AT+NAME=Slave.
/*Get the Slave address to save it for Master*/
AT+ADDR?
(The response will be the module Address, I will save it for Master configuration)
let it = 98d3:a1:fd7a0f
Master:
/*Set master mode.*/
AT+ROLE= 1
/*For secured connection make Master accept only one module via its unique Address.*/
AT+CMODE=0
/*Setting up Baud rate (The same as the Master Baud Rate to proper connection).*/
AT+UART= 9600,0,0
/*Save salve address*/
AT+BIND=98d3,a1,fd7a0f
/*Rename the device.*/
AT+NAME=Master.
/*Change Password.*/
AT+PSWD= 2021
I saw a lot of videos the result of all of them is: the two modules are automatically connected to each other when power is on.
but mine is not!
Were I make any mistake!?
these are some videos that I've watched to achieve my goal:
https://www.youtube.com/watch?v=DgFZE16UKTM&t=31s
https://www.youtube.com/watch?v=BXXAcFOTnBo&t=222s
note:
wiring when AT command was Tx->Tx, Rx->Rx, EN->3v3, GND->GND, VCC->VCC.
wiring when normal condition was Tx->Rx, Rx->Tx, EN->(not connected), GND->GND, VCC->VCC.
I saw a lot of videos the result of all of them is: the two modules
are automatically connected to each other when power is on. but mine
is not!
This confuses me, I can't see any command that will let you initiate connection. My guess is that AT+BIND is a command for trusting. However AT+CMODE is explained as:
Param1: Connection mode: 0 -> Connect the module to the specified
Bluetooth address. (Bluetooth address can be specified by the binding
command)
In this case, I would send AT+BIND first rather than setting CMODE.
If we have a look at HC-05 AT command list, we can see that there are other commands that are used to establish classical Bluetooth connection. I would do the following in order:
AT+PAIR=MAC
AT+BIND=MAC
AT+LINK=MAC
I would also check the status via AT+STATE?.

Arduino nano not responding

Few months ago, I bought cheap arduino nano from china. Instaled all the required drivers, and tried out my frirst program.
Now I tried to upload something new, and I get this error message:
avrdude: ser_open(): can't open device "\.\COM4": System can't find given file.
I also noticed, that Tools->Ports can not be clicked. The device does not even show up in device manager.
Any Ideas?
In my first program I did also set pin 0 and 1 (RX/TX) as outputs and used them to flash LEDs. I am aware, that this probably prevents new code from beeing uploded, but it should not prevent from the device from shoving up at all. The computer talking to the USB driver, not the microcontroller.
Go to Device Manager and find the Arduino COM Port
Go to the Advanced properties of the port
Set the port # to COM1
Then un-plug your USB and plug it back in.

Arduino - Burning Bootloader without External Crystal

I'm trying to burn the bootloader to an ATMEGA328P - AUR, the 32-pin SMD variation with my Arduino Uno. I've tried the recommended way that the Arduino website suggests to burn the bootloader. However, I don't have the 16MHz crystal recommended, so I tried the workaround method they describe to use the internal 8MHz oscillator. Burning the bootloader gives me the "Yikes! Invalid device signature" error. Do you think there is an incompatibility with the chip? Problem with using the internal oscillator? Should I just get the crystal?
For just invalid device signature - (this usually occurs if internal clock is on)
For the ATMEGA328p if it is preloaded with a bootloader for some reason there is a mismatch in signatures so you'll have to do this THEN UNDO IT << please don't forget or else you'll have to bootload everytime before you write a script until you UNDO this.
You'll want to open up the avrdude.conf file in Arduino's program files
for mac: show package contents for PC and Linux just search the Program Files
in this file search for " ATMEGA328P " under it should be a field named signature replace "0x1e 0x95 0x14" (the 328 signature) with "0x1e 0x95 0x0F" (the 328p signature)
Follow step 2 - 4 below, if this works you're all set.
if internal clock is not on a sync error occurs
The ATMEGA328p has an internal oscillator which operates at 8MHz but this oscillator is apparently turned off when the a 16MHz bootloader is burned to it. So if you are gonna burn an 8MHz (lilypad) type bootloader to it you'll have to do so with the 16MHz oscillator in place so the internal clock can be turned on.
To do this:
load ArduinoISP example script on the UNO R3 that you're going to be boot loading with
(Configure in Tools > Boards > LilyPad Arduino or ATMEGA328 on breadboard)
(Configure in Tools > Port > ArduinoISP)
Afterwards you should be ready to burn boot loader
if sync error persist it means that the clocks are missaligned meaning you've got to slow down the boot loader
in the Hardware folder search for a boards.txt file within the avr folder
edit the line in the file containing "atmega328bb.upload.speed=57600" to read "atmega328bb.upload.speed=19200"
try steps 2 - 4 just above again
Try each of these steps in various combinations or appropriately as the problem evolves. If this doesn't seem to work just continue search forums... I had found all this in about 3 hrs on google - good luck!

Serial communication using USB

I am trying to connect ATmega128 uart to PC using USB-to-RS232 converter so that PC can receive and transmit data from microcontroller using hyper terminal. I set the correct stop bits and baud rate in hyper terminal. It doesn't seem to work.
Can any one tell me if this is possible by USB-to-RS232 converter and if not what other options are there for serial communication between PC and microcontroller ?
You should be able to do this without any issues. I'd suggest putting your USB-to-RS232 cable in loopback mode first (if possible) to ensure you can communicate, then connect it back up to your MCU.
If you aren't seeing what you expect the first thing to look at are the settings, specifically the baud rate. Since your USB-to-RS232 cable is from a third party vendor I'd assume that your settings on the host side are OK. So you should look in to your MCU code to ensure that all your clocks are running at the proper speed and you have indeed performed the correct calculations to achieve your desired baud rate. Debugging here to ensure you are transmitting data out of the device is important.
Additionally, there are tools that can help you debug. Portmon is a tool from Microsoft that lets you look at the serial data path on the host side. I'd also recommend a USB analyzer, such as an Ellisys, that will allow you to view data going across the line from your MCU to the host.

Error message in AVR studio4

I have recently purchased an AVR USB programmer from robokits.co.in, was trying to program atmeg8 using AVR studio4 and I get the following when I click on the program options:
a problem occurred when executing the command. make sure u are using
the correct programming method. current mode is ISP verify that the
device is placed in the correct socket, and that the ISP cable is
connected properly.check that the programming frequency specified in
the main page is well below 1/4th of the clock frequency of the
device.
I have tried all that I could think of, I have checked the connections and the freq is below 1/4th of the device.
But that doesn't solve this problem.
I have made the circuit for blinking LEDs program.
See the image for details
Double check that the jumpers on the programming board that you are using (if you are) are set correctly.
Well this is hardly the venue to trouble shoot different hardware issues.
So if you think there is an issue with the programmer, contact www.robokits.com.
I would start with contacting robokits.
Since you can't even enter the programming mode, you can ignore your source code.
You should be able to verify fuses/lock bits w/o programming any code into the Mega8.
To give you a head start before you contact robokits:
1. Verify the programmer is properly installed on your computer following robokits instructions.
2. Verify the +5Vdc on Pins 20 & 7 of the Mega8
3. Verify Pins 22 & 8 are grounded properly.
4. Verify that Pin 1 is pulled up to +5Vdc (when the programmer is not connected)
Pin 1 should be pulled down by the programmer when it attempts to connect to the Mega8
5. Double check all the connections between the programmer to your target. Since the programmer is a 10 pin IDC and the test circuit has an in-line style connector you must have an IDC cable that has been broken out, stripped and connected to the test circuit.
Is the Target "fresh"? i.e. Never been programmed? Regardless: have you tried more than one?
Do you have any power being applied to the ISP header (target) prior to connecting the programmer?
You may also want to verify there are no shorts on your Target pulling the ISP Supply down, see the pinout link below.
If your jumper settings are USB-HID and Slow SCK == open && ISP Supply == short then you shouldn't supply and power to the ISP connection from the target.
If you are not supplying and voltage to the ISP header, maybe you should try that. Remove the ISP Supply jumper and apply 5V from your target application's supply to the ISP interface:
AVR ISP Pinout
Pin 2 on the ISP interface should be +5Vdc in reference to Pin 10 (gnd)
When I got a similar message while programming other Atmel integrated circuits I enabled the "Use external reset" setting that exists in the GUI of AVR Studio 4 (was removed in 5 and returned in Atmel Studio 6).
I am not sure if that option exists or does anything with your programmer since I have never used it.

Resources