Hi all,I'm just starting 'my adventure' with Altera DE2 and I've been given a project that requires reading data from board's registers and passing it to a program on a computer via the Ethernet Port. It sounds like a complicated task and my first idea is to use SOPC Builder for passing the content of registers to Ethernet Controller and then using the demonstration project as a starting point to send it to a computer, where I would initially receive it with Wireshark and later write a program in Java, for example. I would like to ask all of you that have a bit more experience with Altera (since I have none :)) if it is a good way of thinking. What is more, I would be sooooo grateful if you could provide me with some tips (any information on how to do it). Finally, does the ethernet controller do the framing for the information to be sent? Please, if you have some comment for at least one of my doubts, help me... :) Cheers, Adam
Hi,Excuse me, but I can't quite understand what you're saying. What thread are you refering to? I've run the demonstration from the CD, but unfortunately I still don't know how to send data stored in a board's register. Help me :). Cheers, Adam
Thank you very much Alberto.I will analyze it and try to understand as much as possible :). But I'm afraid I will have some more questions in a few days so sorry in advance for being a pain in the *** :). Cheers, Adam
Hi again :),In fact, I have a question right now. Because from what I can see, your project wraps the content to be sent in a UDP framing of some kind. It helps me a bit, but I still need the sent content to be a part of a board's register (for example, some part of SDRAM, instead of a fixed table of numbers). Does anybody know how to do that? I'm also looking forward to see the version that receives the packets as well - good luck with that. Thanks again and hopefully I'll hear from someone again :). Cheers, Adam
Hi Adam.In the snd vector I charge all data, first portion is the ethernet UDP nescesary data header, last four bytes are the CRC, in the middle of them, you simply charge your usefull data, take it out from SDRAM or any place, and load the snd to snd[flenght-4] with it. You also could modify your packet size, anyway, "How to get the data from SDRAM" is another thing, if SDRAM is your NIOS main memory, the data is in the SDRAM yet, if not,..... explain me better which is your case. Recieve part is a nightmare still for me... and I've not free time to play with that this days. :( Cheers. Alberto.
Hi Alberto and others that know something about Altera DE2 and Ethernet,It' me again :). I'm writing cause I have to continue working on the project but I got stuck again. Could you tell me how would you change your program (or the demonstration project) to have the input of a UDP packet read from onboard switches? I already added the component in the SOPC Builder, generated the system and added the files to the Quartus project. What should I do next? Should I change some files in the Quartus Project itself and the C program? Please, I'll be grateful for any help. cheers, Adam
Hi AdamRead the "tut_sopc_introduction_verilogDE2.pdf" in the "DE2_tutorials" folder of the DE2 CD. In Page 19 (last page) there is an example in C language, where says: *LEDs = *Switches Then, instead showing the "switches states" in the LEDs, you can save their state in some memory variable. Cheers Alberto.
Alberto,Thank you. In fact I have not seen your reply and already learnt what I should do by myself. But here is the problem I have now: when I change the content of the packet by putting into the loop TXT[some payload byte] = *switch_pio, it gets changed only once (at the start-up of the demonstration) and then nothing changes when I change the position of the switches. What is more I can't seem to turn LEDs on and off. I have a strange feeling it has something to do with the clock. The problem might be that I'm currently modifying the demonstration of the version 1.1 and I'm working with QuartusII and NiosII of version 8.1. Do you know what might be the problem? And do you have a newer version of the demonstration than 1.1 (in my project I don't really need packets being sent fast)? I can't thank you enough for your help. I already learnt so much :). cheers, Adam
In fact, just a small correction... wherever I put TXT[some payload byte] = *switch_pio in the loop (even after a few packets being sent), the configuration of switches will be read only once and after that every next call to the switches will keep the same value. It's as if reading the switches causes them to freeze.I hope, if there is another version, it'll help. I look forward to hearing from you. cheers, Adam
I was referring to bypassing the cache whenever you access I/O. There's ample documentation and options on how to do this in the Nios II Software Developer's Guide.You can either use one of the IORD commands or OR bit 31 with whatever address you'd like to read. Cheers, - Brendan
Thank you very much. So from what I can understand I can bypass the cache for the switches just by changing their base address in the SOPC Builder, so that the most significant bit (32th) is set to one. Is that right?cheers, Adam