• 0
Bryan_S

how to Parse a ASCII character as an identifier to received UART data?

Question

I have a PC which sends a 5 bytes of data to a PIC microcontroller. Byte 0 is the % character (lets pic know there is incoming data), byte 1 is  ASCII "!" ( to identify that next incoming byte is to control the state of a single power relay), byte 2 ( is the power relay control data), byte 3 is ASCII "?" (used to signal that the next byte of data that will control one of several other mux relays), byte 4 is the mux relay data. Currently the Pic sends only byte 4 to the FPGA UART to control 1 of 43 mux relays. I would like to eliminate the Pic microcontroller all together and just use the FPGA (CMOD S6) to parse those 5 bytes and control all the relays. I'm not sure how to parse these 5 bytes by looking for ASCII characters %, !, and ?. Do I use case statement maybe? Any example on how something like this is done? Yes, I am new at FPGA's but not programming. It is probably simple but I'm drawing a blank on this because of lack of experience. Thanks for any suggestions, it is appreciated.

I am doing this in VHDL.

Edited by Bryan_S
Added description VHDL

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now