CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

FingerPrint Transferring 4 bit

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

FingerPrint Transferring 4 bit
PostPosted: Wed Nov 13, 2019 11:34 pm     Reply with quote

Hi guys, I am going to use fingerprint sensor and the values that I have got are about 34000 and datasheet tell me:
Quote:

ImageBuffer serves for image storage and the image format is 256*288 pixels.
When transferring through UART, to quicken speed, only the upper 4 bits of the pixel is transferred (that is 16 grey degrees). And two adjacent pixels of the same row will form a byte before the transferring. When uploaded to PC, the 16-grey-degree image will be extended to 256-grey-degree format. That ¡s 8-bit BMP format.

I don't know what does it mean exactly. My information about pictures is not good sufficiently. If I put these array in C#, the program gives error. So how can I get arrays in right way, or any person did it? Any simple code or an nice information please. Thank you.
benedictkim



Joined: 14 Nov 2019
Posts: 11

View user's profile Send private message

Re: FingerPrint Transferring 4 bit
PostPosted: Thu Nov 14, 2019 2:02 am     Reply with quote

1pixel = 1bit
ImageBuffer size = 256(Horizontal)*288(Vertical) = 73,228
2^4 = 16
8bit BMP format = 2^8 = 256
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Nov 14, 2019 5:35 am     Reply with quote

You should post a 'link' to the sensor datasheet ! Perhaps someone has already written code for it.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Nov 14, 2019 6:48 am     Reply with quote

The key point is that the sensor is returning 16 grey levels for
each point, but instead of returning these as bytes is combining the values
from two successive pixels into each byte sent.
Now I have to comment that I hope the poster is using something like
a DSPIC?. There is no way that this is a suitable device to be attached to
anything but a very large PIC. Each image is going to involve 36864bytes
of data. (256*288/2), and large data sets are the thing that PIC's are
least suited to working with. I honestly have to say this is the sort of
device much more suited to something like an Arduino, with a lot of RAM....
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Fri Nov 15, 2019 2:49 am     Reply with quote

Probably I should read about bmp file to understand details actually me and my friends working together and I am gonna say him about dspic to search suitable device.Thank you again friends.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Nov 15, 2019 9:21 am     Reply with quote

You need to tell us more about the project.

option #1
IF you want to have the PIC read the sensor and send to PC, then almost any PIC will do the task, but I'd choose one with 2 hardware UARTs. However at 9600 baud it will take about 38 seconds to transfer the data from sensor to PC. If you can set baudrate to 115K200, then a transfer is about 4 seconds.
In this case, main() is a simple loop. Read sensor data, send to PC, loop 36,864 times.

option #2
IF you want to STORE all the sensor data with the PIC, then you'll need some SRAM or FRAM connected to the PIC. Here the PIC reads and saves all 36,864 bytes of sensor data, then transmits the stored data to the PC.
This is slighlty more complicated as Main() here has 2 parts. 1 -capture the sensor data, 2- transmit to PC.


If you want/need the PIC to do anything with the sensor data BEFORE sending to the PC, then you'll need to choose option #2.

Jay
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Sat Nov 16, 2019 2:09 am     Reply with quote

We will use option #1, any PIC to send data to PC as in control. Heavy work will be done in PC that will register all data and compare persons.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sat Nov 16, 2019 2:31 am     Reply with quote

OK. In which case, look at:
<https://en.wikipedia.org/wiki/BMP_file_format>
and search in this for:

"4-bit per pixel (4bpp) format"

This is what is being used by the device.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Nov 16, 2019 6:24 am     Reply with quote

Be sure to choose a PIC with 2 hardware UARTS ! You need very reliable communications.
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Sat Nov 16, 2019 1:08 pm     Reply with quote

Okay thank you guys for information.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group